Average Error: 35.9 → 31.8
Time: 8.0s
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 < 4.54756140803492154e-163

    1. Initial program 37.0

      \[\]
    2. Simplified37.0

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

      \[\leadsto \]
    5. Applied cbrt-div33.3

      \[\leadsto \]
    6. Simplified33.3

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

      \[\leadsto \]
    8. Simplified32.4

      \[\leadsto \]

    if 4.54756140803492154e-163 < g

    1. Initial program 34.8

      \[\]
    2. Simplified34.8

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

      \[\leadsto \]
    5. Applied cbrt-div31.2

      \[\leadsto \]
    6. Using strategy rm
    7. Applied add-cube-cbrt31.2

      \[\leadsto \]
    8. Applied sqrt-prod31.2

      \[\leadsto \]
    9. Simplified31.2

      \[\leadsto \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.8

    \[\leadsto \]

Reproduce

herbie shell --seed 2020179 
(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))))))))