Average Error: 10.8 → 1.3
Time: 7.7s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[x + y \cdot \frac{z - t}{a - t}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
x + y \cdot \frac{z - t}{a - t}
double f(double x, double y, double z, double t, double a) {
        double r663812 = x;
        double r663813 = y;
        double r663814 = z;
        double r663815 = t;
        double r663816 = r663814 - r663815;
        double r663817 = r663813 * r663816;
        double r663818 = a;
        double r663819 = r663818 - r663815;
        double r663820 = r663817 / r663819;
        double r663821 = r663812 + r663820;
        return r663821;
}

double f(double x, double y, double z, double t, double a) {
        double r663822 = x;
        double r663823 = y;
        double r663824 = z;
        double r663825 = t;
        double r663826 = r663824 - r663825;
        double r663827 = a;
        double r663828 = r663827 - r663825;
        double r663829 = r663826 / r663828;
        double r663830 = r663823 * r663829;
        double r663831 = r663822 + r663830;
        return r663831;
}

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

Original10.8
Target1.2
Herbie1.3
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 10.8

    \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity10.8

    \[\leadsto x + \frac{y \cdot \left(z - t\right)}{\color{blue}{1 \cdot \left(a - t\right)}}\]
  4. Applied times-frac1.3

    \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a - t}}\]
  5. Simplified1.3

    \[\leadsto x + \color{blue}{y} \cdot \frac{z - t}{a - t}\]
  6. Final simplification1.3

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

Reproduce

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

  :herbie-target
  (+ x (/ y (/ (- a t) (- z t))))

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