Average Error: 1.2 → 1.2
Time: 12.1s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + y \cdot \frac{z - t}{a - t}\]
x + y \cdot \frac{z - t}{a - t}
x + y \cdot \frac{z - t}{a - t}
double f(double x, double y, double z, double t, double a) {
        double r10663529 = x;
        double r10663530 = y;
        double r10663531 = z;
        double r10663532 = t;
        double r10663533 = r10663531 - r10663532;
        double r10663534 = a;
        double r10663535 = r10663534 - r10663532;
        double r10663536 = r10663533 / r10663535;
        double r10663537 = r10663530 * r10663536;
        double r10663538 = r10663529 + r10663537;
        return r10663538;
}

double f(double x, double y, double z, double t, double a) {
        double r10663539 = x;
        double r10663540 = y;
        double r10663541 = z;
        double r10663542 = t;
        double r10663543 = r10663541 - r10663542;
        double r10663544 = a;
        double r10663545 = r10663544 - r10663542;
        double r10663546 = r10663543 / r10663545;
        double r10663547 = r10663540 * r10663546;
        double r10663548 = r10663539 + r10663547;
        return r10663548;
}

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

    \[x + y \cdot \frac{z - t}{a - t}\]
  2. Final simplification1.2

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

Reproduce

herbie shell --seed 2019156 
(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 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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