Average Error: 11.0 → 1.5
Time: 20.2s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\frac{z - t}{a - t} \cdot y + x\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\frac{z - t}{a - t} \cdot y + x
double f(double x, double y, double z, double t, double a) {
        double r33819379 = x;
        double r33819380 = y;
        double r33819381 = z;
        double r33819382 = t;
        double r33819383 = r33819381 - r33819382;
        double r33819384 = r33819380 * r33819383;
        double r33819385 = a;
        double r33819386 = r33819385 - r33819382;
        double r33819387 = r33819384 / r33819386;
        double r33819388 = r33819379 + r33819387;
        return r33819388;
}

double f(double x, double y, double z, double t, double a) {
        double r33819389 = z;
        double r33819390 = t;
        double r33819391 = r33819389 - r33819390;
        double r33819392 = a;
        double r33819393 = r33819392 - r33819390;
        double r33819394 = r33819391 / r33819393;
        double r33819395 = y;
        double r33819396 = r33819394 * r33819395;
        double r33819397 = x;
        double r33819398 = r33819396 + r33819397;
        return r33819398;
}

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

Original11.0
Target1.3
Herbie1.5
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 11.0

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

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

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

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

    \[\leadsto \color{blue}{\frac{z - t}{\frac{a - t}{y}}} + x\]
  8. Using strategy rm
  9. Applied associate-/r/1.5

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

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

Reproduce

herbie shell --seed 2019174 +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))))