Average Error: 11.1 → 1.4
Time: 15.4s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[x + t \cdot \frac{y - z}{a - z}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
x + t \cdot \frac{y - z}{a - z}
double f(double x, double y, double z, double t, double a) {
        double r26390489 = x;
        double r26390490 = y;
        double r26390491 = z;
        double r26390492 = r26390490 - r26390491;
        double r26390493 = t;
        double r26390494 = r26390492 * r26390493;
        double r26390495 = a;
        double r26390496 = r26390495 - r26390491;
        double r26390497 = r26390494 / r26390496;
        double r26390498 = r26390489 + r26390497;
        return r26390498;
}

double f(double x, double y, double z, double t, double a) {
        double r26390499 = x;
        double r26390500 = t;
        double r26390501 = y;
        double r26390502 = z;
        double r26390503 = r26390501 - r26390502;
        double r26390504 = a;
        double r26390505 = r26390504 - r26390502;
        double r26390506 = r26390503 / r26390505;
        double r26390507 = r26390500 * r26390506;
        double r26390508 = r26390499 + r26390507;
        return r26390508;
}

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

Original11.1
Target0.6
Herbie1.4
\[\begin{array}{l} \mathbf{if}\;t \lt -1.068297449017406694366747246993994850729 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.911094988758637497591020599238553861375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]

Derivation

  1. Initial program 11.1

    \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
  2. Using strategy rm
  3. Applied associate-/l*2.8

    \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}}\]
  4. Using strategy rm
  5. Applied associate-/r/1.4

    \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t}\]
  6. Final simplification1.4

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

Reproduce

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

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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