Average Error: 1.3 → 1.2
Time: 21.7s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + \frac{y}{\frac{a}{z - t} - \frac{t}{z - t}}\]
x + y \cdot \frac{z - t}{a - t}
x + \frac{y}{\frac{a}{z - t} - \frac{t}{z - t}}
double f(double x, double y, double z, double t, double a) {
        double r28055335 = x;
        double r28055336 = y;
        double r28055337 = z;
        double r28055338 = t;
        double r28055339 = r28055337 - r28055338;
        double r28055340 = a;
        double r28055341 = r28055340 - r28055338;
        double r28055342 = r28055339 / r28055341;
        double r28055343 = r28055336 * r28055342;
        double r28055344 = r28055335 + r28055343;
        return r28055344;
}

double f(double x, double y, double z, double t, double a) {
        double r28055345 = x;
        double r28055346 = y;
        double r28055347 = a;
        double r28055348 = z;
        double r28055349 = t;
        double r28055350 = r28055348 - r28055349;
        double r28055351 = r28055347 / r28055350;
        double r28055352 = r28055349 / r28055350;
        double r28055353 = r28055351 - r28055352;
        double r28055354 = r28055346 / r28055353;
        double r28055355 = r28055345 + r28055354;
        return r28055355;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.3
Target0.4
Herbie1.2
\[\begin{array}{l} \mathbf{if}\;y \lt -8.508084860551241069024247453646278348229 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.894426862792089097262541964056085749132 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Initial program 1.3

    \[x + y \cdot \frac{z - t}{a - t}\]
  2. Using strategy rm
  3. Applied clear-num1.4

    \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a - t}{z - t}}}\]
  4. Using strategy rm
  5. Applied un-div-inv1.2

    \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\]
  6. Using strategy rm
  7. Applied div-sub1.2

    \[\leadsto x + \frac{y}{\color{blue}{\frac{a}{z - t} - \frac{t}{z - t}}}\]
  8. Final simplification1.2

    \[\leadsto x + \frac{y}{\frac{a}{z - t} - \frac{t}{z - t}}\]

Reproduce

herbie shell --seed 2019169 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

  (+ x (* y (/ (- z t) (- a t)))))