Base.runtests("math") failures on chips older than haswell

Hello all,

I’ve just started playing with Julia. At this point, I’m just downloading the binaries and running tests. So far anything haswell and newer runs the tests just fine, but when I run:

Base.runtests(“math”)

on anything Ivybridge and older, I get the errors below. I’ve tried building (on a sandybridge) and I got the same issue. Are ivybridge and older not supported?

julia> Base.runtests(“math”)
Test (Worker) | Time (s) | GC (s) | GC % | Alloc (MB) | RSS (MB)
math (1) | started at 2021-08-06T09:35:01.952
math (1) | failed at 2021-08-06T09:36:20.429
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.944523863465552361567241714265293580330960142053956707348245762162446267954062e-11 <= 2.9103830456733704e-11
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.239620282260873206209898403825869801009469955615602346959597919321384586334519e-10 <= 1.1641532182693481e-10
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.208398170281759836009218990986729301057788040439471503398687866159506464463257e-10 <= 1.1641532182693481e-10
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.47627877963448246139281304052899240647219697425288315010663855420264172632325e-10 <= 2.3283064365386963e-10
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.605108531456578179829673301819172730739412111696025914478914399435490480802057e-10 <= 2.3283064365386963e-10
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.477387838578831433630323999934486154823113319326355110970641933049857517391576e-10 <= 2.3283064365386963e-10
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.478775289005531518827211075087809243630139221300062171051205945145799897450122e-10 <= 2.3283064365386963e-10
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.349584940787210028151044089360728120286499165962432230702632231316709858620677e-10 <= 2.3283064365386963e-10
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 9.886864436634399748241004932115747133388310463800831336556764588114818918907741e-10 <= 9.313225746154785e-10
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 4.823588352461727291861554965112121088229437682143749089037056700959904090059565e-07 <= 4.76837158203125e-7
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 9.832422504043911614672568645746468699749618874563042253403238641815601759807441e-07 <= 9.5367431640625e-7
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 4.024522243057574020729461844930154048809148910536720401681924445062456231344194e-06 <= 3.814697265625e-6
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.671096080451412160855988051660662099688638931875817473912035360241553260203968e-05 <= 1.52587890625e-5
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 6.253028585631435401436436513153638670269367331587039038179288941589419884240247e-05 <= 6.103515625e-5
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 6.152892080403847793533119813268375575438437323276936013781464852247444865044712e-05 <= 6.103515625e-5
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.200336854259549472074926238941724855170910281948893693758563977706877442208179e-38 <= 1.1754943508222875e-38
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.407534186038450553460324520873833223076559806755081343173968657075339966387494e-38 <= 2.350988701644575e-38
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 4.04403479998216584240500353597032820416909909200572523597887708037061451531782e-34 <= 3.851859888774472e-34
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.547000867037565887731033124057916742861446876878655292159330808009113589193681e-33 <= 1.5407439555097887e-33
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.359381443902298604050333477102128548488187396439064659820736079955544135889552e-29 <= 1.262177448353619e-29
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 7.622172891967228201974472453931445301626212887988520784804774877322523939447388e-15 <= 7.105427357601002e-15
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.944523863465552361567241714265293580330960142053956707348245762162446267954062e-11 <= 2.9103830456733704e-11
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.605108531456578179829673301819172730739412111696025914478914399435490480802057e-10 <= 2.3283064365386963e-10
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.477387838578831433630323999934486154823113319326355110970641933049857517391576e-10 <= 2.3283064365386963e-10
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 9.832422504043911614672568645746468699749618874563042253403238641815601759807441e-07 <= 9.5367431640625e-7
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 4.121652904892606052685003491214126582282599824011749377470572011799259625487621 <= 4.0
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 4163.426880704978502421816698819664749573392932735233623596233692188840003351208 <= 4096.0
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 17822.67472567509917126448919163683321959654609696406980989364056689933505907784 <= 16384.0
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 16527.93694692877878898624994027849956771816334482673658660075831545467265425888 <= 16384.0
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 17512.91864800695083094188818273637839932993550170807086656350754272927340441028 <= 16384.0
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.095124633509427465540275439400764106209920731364018235913546029993712043440284e+09 <= 1.073741824e9
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.442598158324992290694219908876174156982453841420944535786070318064847936399543e+18 <= 2.305843009213694e18
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 5.227490995007697337338820063112673023294806493480370801898843835496083049937824e+18 <= 4.611686018427388e18
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.646238226925277080266453015385370447928355932630334495724553017617824145270275e+23 <= 1.5111572745182865e23
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 3.116802563226568944214562002155919921995251306054576493147635003810339597006461e+23 <= 3.022314549036573e23

Test Summary: | Pass Fail Total
Overall | 1520108 35 1520143
math | 1520108 35 1520143
FAILURE

The global RNG seed was 0xbfaa57e47a413c78e5eead43b1ea8efa.

Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.944523863465552361567241714265293580330960142053956707348245762162446267954062e-11 <= 2.9103830456733704e-11
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.239620282260873206209898403825869801009469955615602346959597919321384586334519e-10 <= 1.1641532182693481e-10
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.208398170281759836009218990986729301057788040439471503398687866159506464463257e-10 <= 1.1641532182693481e-10
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.47627877963448246139281304052899240647219697425288315010663855420264172632325e-10 <= 2.3283064365386963e-10
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.605108531456578179829673301819172730739412111696025914478914399435490480802057e-10 <= 2.3283064365386963e-10
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.477387838578831433630323999934486154823113319326355110970641933049857517391576e-10 <= 2.3283064365386963e-10
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.478775289005531518827211075087809243630139221300062171051205945145799897450122e-10 <= 2.3283064365386963e-10
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.349584940787210028151044089360728120286499165962432230702632231316709858620677e-10 <= 2.3283064365386963e-10
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 9.886864436634399748241004932115747133388310463800831336556764588114818918907741e-10 <= 9.313225746154785e-10
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 4.823588352461727291861554965112121088229437682143749089037056700959904090059565e-07 <= 4.76837158203125e-7
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 9.832422504043911614672568645746468699749618874563042253403238641815601759807441e-07 <= 9.5367431640625e-7
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 4.024522243057574020729461844930154048809148910536720401681924445062456231344194e-06 <= 3.814697265625e-6
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.671096080451412160855988051660662099688638931875817473912035360241553260203968e-05 <= 1.52587890625e-5
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 6.253028585631435401436436513153638670269367331587039038179288941589419884240247e-05 <= 6.103515625e-5
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 6.152892080403847793533119813268375575438437323276936013781464852247444865044712e-05 <= 6.103515625e-5
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.200336854259549472074926238941724855170910281948893693758563977706877442208179e-38 <= 1.1754943508222875e-38
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.407534186038450553460324520873833223076559806755081343173968657075339966387494e-38 <= 2.350988701644575e-38
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 4.04403479998216584240500353597032820416909909200572523597887708037061451531782e-34 <= 3.851859888774472e-34
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.547000867037565887731033124057916742861446876878655292159330808009113589193681e-33 <= 1.5407439555097887e-33
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.359381443902298604050333477102128548488187396439064659820736079955544135889552e-29 <= 1.262177448353619e-29
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 7.622172891967228201974472453931445301626212887988520784804774877322523939447388e-15 <= 7.105427357601002e-15
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.944523863465552361567241714265293580330960142053956707348245762162446267954062e-11 <= 2.9103830456733704e-11
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.605108531456578179829673301819172730739412111696025914478914399435490480802057e-10 <= 2.3283064365386963e-10
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.477387838578831433630323999934486154823113319326355110970641933049857517391576e-10 <= 2.3283064365386963e-10
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 9.832422504043911614672568645746468699749618874563042253403238641815601759807441e-07 <= 9.5367431640625e-7
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 4.121652904892606052685003491214126582282599824011749377470572011799259625487621 <= 4.0
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 4163.426880704978502421816698819664749573392932735233623596233692188840003351208 <= 4096.0
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 17822.67472567509917126448919163683321959654609696406980989364056689933505907784 <= 16384.0
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 16527.93694692877878898624994027849956771816334482673658660075831545467265425888 <= 16384.0
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 17512.91864800695083094188818273637839932993550170807086656350754272927340441028 <= 16384.0
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.095124633509427465540275439400764106209920731364018235913546029993712043440284e+09 <= 1.073741824e9
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 2.442598158324992290694219908876174156982453841420944535786070318064847936399543e+18 <= 2.305843009213694e18
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 5.227490995007697337338820063112673023294806493480370801898843835496083049937824e+18 <= 4.611686018427388e18
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 1.646238226925277080266453015385370447928355932630334495724553017617824145270275e+23 <= 1.5111572745182865e23
Error in testset math:
Test Failed at /home/hexboy/julia-1.6.2/share/julia/test/math.jl:296
Expression: abs(y - yb) <= 1.0 * eps(T(yb))
Evaluated: 3.116802563226568944214562002155919921995251306054576493147635003810339597006461e+23 <= 3.022314549036573e23
ERROR: LoadError: Test run finished with errors
in expression starting at /home/hexboy/julia-1.6.2/share/julia/test/runtests.jl:84
ERROR: A test has failed. Please submit a bug report (Issues · JuliaLang/julia · GitHub)
including error messages above and the output of versioninfo():
Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core™ i7 CPU M 620 @ 2.67GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, westmere)

Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] runtests(tests::String; ncores::Int64, exit_on_error::Bool, revise::Bool, seed::Nothing)
@ Base ./util.jl:578
[3] runtests(tests::String)
@ Base ./util.jl:563
[4] top-level scope
@ REPL[1]:1

caused by: failed process: Process(setenv(/home/hexboy/julia-1.6.2/bin/julia -Cnative -J/home/hexboy/julia-1.6.2/lib/julia/sys.so -g1 /home/hexboy/julia-1.6.2/bin/../share/julia/test/runtests.jl math,[“PATH=/home/hexboy/blender-2.79b:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin”, “QT_ACCESSIBILITY=1”, “DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus”, “XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0”, “XDG_SESSION_DESKTOP=cinnamon”, “GTK_OVERLAY_SCROLLING=1”, “SSH_AGENT_PID=1108”, “XDG_SESSION_TYPE=x11”, “USER=hexboy”, “XDG_CONFIG_DIRS=/etc/xdg/xdg-cinnamon:/etc/xdg” … “XDG_SESSION_CLASS=user”, “DISPLAY=:0”, “GJS_DEBUG_TOPICS=JS ERROR;JS LOG”, “LANGUAGE=en_US”, “XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/hexboy”, “XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0”, “XDG_VTNR=7”, “XDG_SESSION_ID=c2”, “LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:*.xspf=00;36:”, “OPENBLAS_MAIN_FREE=1”]), ProcessExited(1)) [1]

Stacktrace:
[1] pipeline_error
@ ./process.jl:525 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base ./process.jl:440
[3] run
@ ./process.jl:438 [inlined]
[4] runtests(tests::String; ncores::Int64, exit_on_error::Bool, revise::Bool, seed::Nothing)
@ Base ./util.jl:572
[5] runtests(tests::String)
@ Base ./util.jl:563
[6] top-level scope
@ REPL[1]:1

julia>

I just tested on a Westmere as well and I received the same errors.

It relies on muladdfma for accuracy. This happens on Haswell and newer, because Haswell and newer have dedicated fma instructions, while Ivy Bridge and Westmere do not.

fma is unfortunately very slow on these CPUs, but might be worth using it anyway, favoring speed over accuracy. This does mean that the implementations would be highly suboptimal for these CPUs, but base Julia doesn’t provide good functionality for switching implementations.
The change the older architectures would want, using compensated arithmetic, has only minor performance implications unlike whatever LLVM does to guarantee exact rounding.

This is what I use in VectorizationBase and SLEEFPirates:

# fma_fast() returns either `True()` or `False()`
# It gets redefined in the `__init__()` if it happens to be wrong
@inline fast_fma(a, b, c) = fast_fma(a, b, c, fma_fast())
@inline fast_fma(a, b, c, ::True) = fma(a, b, c)
@inline function fast_fma(a, b, c, ::False)
    # dadd and dmul use double-double arithmetic
    d = dadd(dmul(Double(a),Double(b),False()),Double(c))
    add_ieee(d.hi, d.lo) # add obeys IEEE semantics
end

This could be written more explicitly by inlining things, but was my lazy implementation that got SLEEFPirates.jl’s tests to pass on Ivy Bridge.
It’d likely be good enough for base’s tests as well. But we unfortunately have no way to dispatch in base based on the CPU having FMA instructions.

@Oscar_Smith
Maybe just replace muladds with fmas?

3 Likes

The reason I did this the way I did was I figured that people would prefer losing a little accuracy rather than have 100x slower elementary functions. As such, I think the 2 best solutions are either to shortly loosen the tray on CPUs without fma, or to just write a fallback implimentation for them.

Makes sense. I’m happy having an explanation. I can update the user documentation on my end for now.

This is the test set that fails:

@testset "exp function" for T in (Float64, Float32)
    @testset "$T accuracy" begin
        X = map(T, vcat(-10:0.0002:10, -80:0.001:80, 2.0^-27, 2.0^-28, 2.0^-14, 2.0^-13))
        for x in X
            y, yb = exp(x), exp(big(x))
            @test abs(y-yb) <= 1.0*eps(T(yb))
        end
    end
    @testset "$T edge cases" begin
        @test isnan_type(T, exp(T(NaN)))
        @test exp(T(-Inf)) === T(0.0)
        @test exp(T(Inf)) === T(Inf)
        @test exp(T(0.0)) === T(1.0) # exact
        @test exp(T(5000.0)) === T(Inf)
        @test exp(T(-5000.0)) === T(0.0)
    end
end

Fails on my IvyBridge as well. There is one little boo-boo in the code–the conversion of x to BigFloat. For example, one of the test values is x=-7.988

julia> x=-7.988
-7.988

julia> z=big(x)
-7.98800000000000043343106881366111338138580322265625

julia> exp(x)-exp(z)
-6.875357276975877021034327111301830058376032887058691738948989190690502068289917e-21

julia> w=BigFloat(string(x))
-7.987999999999999999999999999999999999999999999999999999999999999999999999999993

julia> exp(x)-exp(w)
-1.540305925358389286374676262298504478625373433257642019437989077979534631976859e-19

julia> exp(z)
0.0003395124296503243699399635581465312771639644718746449997822828870586917389489892

julia> exp(w)
0.0003395124296503245170951988170095828935972635904232628039435933257642019437989078

What is the “correct” value of exp(-7.988)?

0.0003395124296503245170951988170095828935972635904232628039435933257642019437989041010722263991870498980819486361427826398053908

Although this little correction makes it worse, not better! Prior error -6.87 E-21 versus new error -1.54E-19 !

Explanation was to why IvyBridge is worse has already been provided.

This is wrong. -7.88 in Julia doesn’t mean -788//100, it means the closest floating point number to -7.88. as such, big(x) is the correct value to compare against.

1 Like
julia> x=-7.988
-7.988

julia> z=big(x)
-7.98800000000000043343106881366111338138580322265625

julia> w=BigFloat(string(x))
-7.987999999999999999999999999999999999999999999999999999999999999999999999999993
-7.988 - (-7.987999999999999999999999999999999999999999999999999999999999999999999999999993)
= -7E-78
-7.988 - (-7.98800000000000043343106881366111338138580322265625) 
= 4.3343106881366111338138580322265625E-16

Did you run the last 2 code blocks? That’s not what Julia answers. It will give 0.0 for both of them.

julia> function signif(x::Float64)
           xu = reinterpret(UInt64, x)
           s = big"0" // big"1"
           for i ∈ 0:51
               if xu % Bool
                   s += big"1" // big"2"^(52-i)
               end
               xu >>= 1
           end
           s
       end
signif (generic function with 1 method)

julia> x
-7.988

julia> xbigrational = (-1) ^ signbit(x) * (signif(x) + 1) * big(2) ^ (exponent(x))
-8993688455858881//1125899906842624

julia> Float64(xbigrational)
-7.988

julia> BigFloat(xbigrational)
-7.98800000000000043343106881366111338138580322265625

julia> big(x)
-7.98800000000000043343106881366111338138580322265625

julia> numerator(xbigrational) / denominator(xbigrational)
-7.98800000000000043343106881366111338138580322265625

For Float64, Julia prints something that looks pretty and can be parsed back to the exact binary representation. That doesn’t mean the printing is not rounded.

Above, I use the definition of Float64 to convert x into a representation using Rational{BigInt}, which we can then convert into Float64 and BigFloat at our leisure.
The rational representation xbigrational is “exact”.
Performing the division (converting to big float) gives us the same thing we got with big(x).

In terms of representations of what x actually is, the Rational{BigInt} is exact, the decimal BigFloat representation is close, and the Float64 representation is slightly less close – but still close enough to recover the exact binary representation (if we know the decimals are representing a Float64).

Don’t confuse the show method with what is under the hood.

Also, FWIW, Rational{Int64} would’ve been enough for an exact representation.

julia> function signifint64(x::Float64)
           xu = reinterpret(UInt64, x)
           s = 0 // 1
           for i ∈ 0:51
               if xu % Bool
                   s += 1 // 2^(52-i)
               end
               xu >>= 1
           end
           s
       end
signifint64 (generic function with 1 method)

julia> xrational = (-1) ^ signbit(x) * (signifint64(x) + 1) * 2 ^ (exponent(x))
-8993688455858881//1125899906842624

julia> typeof(ans)
Rational{Int64}

julia> convert(Rational, x)
-8993688455858881//1125899906842624

julia> typeof(ans)
Rational{Int64}
5 Likes

While

-8993688455858881/1125899906842624 =
-7.98800000000000043343106881366111338138580322265625

The value -7.988 is exactly represented by 1997/250

-1997/250 =
-7.988

The difference between -8993688455858881/1125899906842624 and -1997/250 represents the error if the Float64 representation of -7.988.

julia> bitstring(-7.988)
"1100000000011111111100111011011001000101101000011100101011000001"

Breaking this down into IEEE 754 format we have:

Part Binary Decimal
sign 1 -1
Exponent 10000000001 1025
Fraction 1111111100111011011001000101101000011100101011000001 0.9970000000000001083577672034152783453464508056640625
Exact -7.98800000000000043343106881366111338138580322265625

The IEEE 754 double precision (64 bit) format has 15.95 decimal digits of precision. Let’s look a little closer at the exact decimal value:

Numberprecission

We see that -7.988 is represented represented to 15 digits as -7.988000000000000

What is 43343106881366111338138580322265625? It’s error.

So if you want to compute the Float64 accuracy for the exp() function, you compare it to a higher precision representation of -7.988.

A higher precision representation of -7.988 is:

julia> w=BigFloat(string(-7.988),RoundUp)
-7.987999999999999999999999999999999999999999999999999999999999999999999999999993

You could also do

julia> v=BigFloat(string(-7.988),RoundDown)
-7.988000000000000000000000000000000000000000000000000000000000000000000000000062

However, “w” is slightly closer to -7.988 that “v” is. So use “w”.

exp(w) gives us a higher accuracy value of exp(-7.988):

julia> exp(w)
0.0003395124296503245170951988170095828935972635904232628039435933257642019437989078

Compare this to the exact value:


We see that exp(w) only mismatches the exact value at the last two digits.

Now compare this to:

julia> x = -7.988  # Float64
-7.988

julia> z=big(x)
-7.98800000000000043343106881366111338138580322265625

julia> exp(x)
0.00033951242965032436

julia> exp(z)
0.0003395124296503243699399635581465312771639644718746449997822828870586917389489892

Now compare exp(x), exp(z) to the exact value:

You see that exp(x) and exp(z) are well matched, but exp(z) is mismatched from the exact value.

In effect, by using z=big(x), one is copying the error from the Float64 representation to a higher bit (BigFloat, 256 bit) representation.

It’s no wonder that exp(x)-exp(z) (about -6.87E-21) is lower than exp(x)-exp(w) (about -1.54E-19), as z copies the error from x.

But if your goal is to check the accuracy for Float64 in computing exp()

@testset "exp function" for T in (Float64, Float32)
    @testset "$T accuracy" begin

Then you would compare exp(x) to a exp(w), as “w” is closer to -7.988 than “x” is.

Furthermore, what do you compare the difference to?

Currently, the test compares it to eps(BigFloat):

            y, yb = exp(x), exp(big(x))
            @test abs(y-yb) <= 1.0*eps(T(yb))

For the value x=-7.988, eps(T(yb)) evaluates to about 4.2E-81; if we used eps(T(y)) instead, it would evaluate to about 5.4E-20.

It would seem if you’re checking the accuracy of Float64, you would compare it to the eps of Float64, and not the eps of BigFloat.

So perhaps that check should be:

            y, yb = exp(x), exp(BigFloat(string(x)))
            @test abs(y-yb) <= one(T)*eps(T(y))

Yes.
When measuring the accuracy of exp(x::Float64), we’d want to use the exact value of x as a big float, meaning big(x) and not BigFloat(string(-7.988),RoundUp) would be the correct comparison.

By this do you mean “including the impact of Float64’s error on the result”?
If someone is interested in particular decimal values (like -7.988), then I could see how that may be a priority / something worth analyzing.

But for testing functions and developing the polynomial approximations needed, we’d fit towards the exact values.
It’d be more complicated, but perhaps some concept of “minmax over range of representable floating points” makes sense. I.e., you’d consider the maximum deviation of exp(::BigFloat) over the entire range of BigFloat values that would round to the given x.

2 Likes

As a user, I want the value of exp(-7.988).
When I set a variable to -7.988 with Float64, it gets stored as
-7.98800000000000043343106881366111338138580322265625

So when I compute exp(-7.988), I get:
0.00033951242965032436

However, the exact value of exp(-7.988) is
0.00033951242965032452

x 15 dig vs exact

The error is:
1.9E-16

That’s the error I want to know about.

You can’t separate the error of the representation of x as Float64 from the calculation of exp().

If you wanted to compute the accuracy of exp() independent of the representation of Float64, you would skip Float64 use BigFloat and compare it to known exact values.

julia> w=BigFloat(string(-7.988),RoundUp)
-7.987999999999999999999999999999999999999999999999999999999999999999999999999993

julia> exp(w)
0.0003395124296503245170951988170095828935972635904232628039435933257642019437989078

Then the comparison is:

exact comparison

The error is 3.7E-81 .

To compare Float64(-7.988) with big(-7.988) seems kind of pointless because, duh, you would expect them to match closely. It’s not checking the “accuracy” of exp(), as the inputs are essentially the same.