Average Error: 10.9 → 5.0
Time: 5.5s
Precision: binary64
\[\]
\[\]

Error

Bits error versus x

Bits error versus y

Target

Original10.9
Target8.0
Herbie5.0
\[\]

Derivation

  1. Split input into 4 regimes
  2. if y < -3.992462048211031e29

    1. Initial program 32.0

      \[\]
    2. Simplified32.0

      \[\leadsto \]
    3. Taylor expanded around -inf 0.1

      \[\leadsto \]
    4. Simplified0.0

      \[\leadsto \]

    if -3.992462048211031e29 < y < 4862.0873297632043

    1. Initial program 1.1

      \[\]
    2. Simplified1.1

      \[\leadsto \]
    3. Using strategy rm
    4. Applied clear-num1.1

      \[\leadsto \]

    if 4862.0873297632043 < y < 3.8600846319785372e102

    1. Initial program 35.1

      \[\]
    2. Simplified35.1

      \[\leadsto \]
    3. Using strategy rm
    4. Applied add-log-exp22.6

      \[\leadsto \]

    if 3.8600846319785372e102 < y

    1. Initial program 29.6

      \[\]
    2. Simplified29.6

      \[\leadsto \]
    3. Using strategy rm
    4. Applied add-sqr-sqrt30.3

      \[\leadsto \]
    5. Applied add-sqr-sqrt31.5

      \[\leadsto \]
    6. Applied times-frac31.5

      \[\leadsto \]
    7. Applied unpow-prod-down15.4

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020190 
(FPCore (x y)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
  :precision binary64

  :herbie-target
  (if (< y -3.7311844206647956e+94) (/ (exp (/ -1.0 y)) x) (if (< y 2.817959242728288e+37) (/ (pow (/ x (+ y x)) x) x) (if (< y 2.347387415166998e+178) (log (exp (/ (pow (/ x (+ y x)) x) x))) (/ (exp (/ -1.0 y)) x))))

  (/ (exp (* x (log (/ x (+ x y))))) x))