Average Error: 1.6 → 1.6
Time: 10.4s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right)\]
x + y \cdot \frac{z - t}{a - t}
x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right)
double f(double x, double y, double z, double t, double a) {
        double r497997 = x;
        double r497998 = y;
        double r497999 = z;
        double r498000 = t;
        double r498001 = r497999 - r498000;
        double r498002 = a;
        double r498003 = r498002 - r498000;
        double r498004 = r498001 / r498003;
        double r498005 = r497998 * r498004;
        double r498006 = r497997 + r498005;
        return r498006;
}

double f(double x, double y, double z, double t, double a) {
        double r498007 = x;
        double r498008 = y;
        double r498009 = z;
        double r498010 = t;
        double r498011 = r498009 - r498010;
        double r498012 = 1.0;
        double r498013 = a;
        double r498014 = r498013 - r498010;
        double r498015 = r498012 / r498014;
        double r498016 = r498011 * r498015;
        double r498017 = r498008 * r498016;
        double r498018 = r498007 + r498017;
        return r498018;
}

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.6
Target0.5
Herbie1.6
\[\begin{array}{l} \mathbf{if}\;y \lt -8.50808486055124107 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.8944268627920891 \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.6

    \[x + y \cdot \frac{z - t}{a - t}\]
  2. Using strategy rm
  3. Applied div-inv1.6

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

    \[\leadsto x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right)\]

Reproduce

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

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

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