Average Error: 1.2 → 1.2
Time: 9.5s
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 r633790 = x;
        double r633791 = y;
        double r633792 = z;
        double r633793 = t;
        double r633794 = r633792 - r633793;
        double r633795 = a;
        double r633796 = r633795 - r633793;
        double r633797 = r633794 / r633796;
        double r633798 = r633791 * r633797;
        double r633799 = r633790 + r633798;
        return r633799;
}

double f(double x, double y, double z, double t, double a) {
        double r633800 = x;
        double r633801 = y;
        double r633802 = z;
        double r633803 = t;
        double r633804 = r633802 - r633803;
        double r633805 = 1.0;
        double r633806 = a;
        double r633807 = r633806 - r633803;
        double r633808 = r633805 / r633807;
        double r633809 = r633804 * r633808;
        double r633810 = r633801 * r633809;
        double r633811 = r633800 + r633810;
        return r633811;
}

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.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.2

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

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

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

Reproduce

herbie shell --seed 2020047 +o rules:numerics
(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)))))