Average Error: 1.2 → 1.2
Time: 8.7s
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 r643926 = x;
        double r643927 = y;
        double r643928 = z;
        double r643929 = t;
        double r643930 = r643928 - r643929;
        double r643931 = a;
        double r643932 = r643931 - r643929;
        double r643933 = r643930 / r643932;
        double r643934 = r643927 * r643933;
        double r643935 = r643926 + r643934;
        return r643935;
}

double f(double x, double y, double z, double t, double a) {
        double r643936 = x;
        double r643937 = y;
        double r643938 = z;
        double r643939 = t;
        double r643940 = r643938 - r643939;
        double r643941 = 1.0;
        double r643942 = a;
        double r643943 = r643942 - r643939;
        double r643944 = r643941 / r643943;
        double r643945 = r643940 * r643944;
        double r643946 = r643937 * r643945;
        double r643947 = r643936 + r643946;
        return r643947;
}

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 
(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)))))