Average Error: 36.3 → 32.0
Time: 8.4s
Precision: binary64
\[\]
\[\]

Error

Bits error versus g

Bits error versus h

Bits error versus a

Derivation

  1. Split input into 2 regimes
  2. if g < -2.21602016964167287e-161

    1. Initial program 34.7

      \[\]
    2. Simplified34.7

      \[\leadsto \]
    3. Using strategy rm
    4. Applied associate-*r/34.7

      \[\leadsto \]
    5. Applied cbrt-div30.7

      \[\leadsto \]
    6. Simplified30.7

      \[\leadsto \]
    7. Taylor expanded around -inf 30.9

      \[\leadsto \]
    8. Simplified30.9

      \[\leadsto \]

    if -2.21602016964167287e-161 < g

    1. Initial program 37.7

      \[\]
    2. Simplified37.7

      \[\leadsto \]
    3. Using strategy rm
    4. Applied associate-*r/37.7

      \[\leadsto \]
    5. Applied cbrt-div34.1

      \[\leadsto \]
    6. Taylor expanded around inf 32.9

      \[\leadsto \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.0

    \[\leadsto \]

Reproduce

herbie shell --seed 2020180 
(FPCore (g h a)
  :name "2-ancestry mixing, positive discriminant"
  :precision binary64
  (+ (cbrt (* (/ 1.0 (* 2.0 a)) (+ (neg g) (sqrt (- (* g g) (* h h)))))) (cbrt (* (/ 1.0 (* 2.0 a)) (- (neg g) (sqrt (- (* g g) (* h h))))))))