Average Error: 1.3 → 1.3
Time: 1.0m
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 r29299612 = x;
        double r29299613 = y;
        double r29299614 = z;
        double r29299615 = t;
        double r29299616 = r29299614 - r29299615;
        double r29299617 = a;
        double r29299618 = r29299617 - r29299615;
        double r29299619 = r29299616 / r29299618;
        double r29299620 = r29299613 * r29299619;
        double r29299621 = r29299612 + r29299620;
        return r29299621;
}

double f(double x, double y, double z, double t, double a) {
        double r29299622 = x;
        double r29299623 = y;
        double r29299624 = z;
        double r29299625 = t;
        double r29299626 = r29299624 - r29299625;
        double r29299627 = a;
        double r29299628 = r29299627 - r29299625;
        double r29299629 = r29299626 / r29299628;
        double r29299630 = r29299623 * r29299629;
        double r29299631 = r29299622 + r29299630;
        return r29299631;
}

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.3
\[\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.0}{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. Final simplification1.3

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

Reproduce

herbie shell --seed 2019165 
(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)))))