Average Error: 10.2 → 1.2
Time: 18.3s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[y \cdot \frac{z - t}{a - t} + x\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
y \cdot \frac{z - t}{a - t} + x
double f(double x, double y, double z, double t, double a) {
        double r26706886 = x;
        double r26706887 = y;
        double r26706888 = z;
        double r26706889 = t;
        double r26706890 = r26706888 - r26706889;
        double r26706891 = r26706887 * r26706890;
        double r26706892 = a;
        double r26706893 = r26706892 - r26706889;
        double r26706894 = r26706891 / r26706893;
        double r26706895 = r26706886 + r26706894;
        return r26706895;
}

double f(double x, double y, double z, double t, double a) {
        double r26706896 = y;
        double r26706897 = z;
        double r26706898 = t;
        double r26706899 = r26706897 - r26706898;
        double r26706900 = a;
        double r26706901 = r26706900 - r26706898;
        double r26706902 = r26706899 / r26706901;
        double r26706903 = r26706896 * r26706902;
        double r26706904 = x;
        double r26706905 = r26706903 + r26706904;
        return r26706905;
}

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.2
Target1.1
Herbie1.2
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 10.2

    \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
  2. Simplified3.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)}\]
  3. Using strategy rm
  4. Applied fma-udef3.0

    \[\leadsto \color{blue}{\frac{y}{a - t} \cdot \left(z - t\right) + x}\]
  5. Using strategy rm
  6. Applied div-inv3.1

    \[\leadsto \color{blue}{\left(y \cdot \frac{1}{a - t}\right)} \cdot \left(z - t\right) + x\]
  7. Applied associate-*l*1.2

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

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

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

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"

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

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