Average Error: 10.8 → 1.2
Time: 4.1s
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 r1092271 = x;
        double r1092272 = y;
        double r1092273 = z;
        double r1092274 = t;
        double r1092275 = r1092273 - r1092274;
        double r1092276 = r1092272 * r1092275;
        double r1092277 = a;
        double r1092278 = r1092277 - r1092274;
        double r1092279 = r1092276 / r1092278;
        double r1092280 = r1092271 + r1092279;
        return r1092280;
}

double f(double x, double y, double z, double t, double a) {
        double r1092281 = y;
        double r1092282 = z;
        double r1092283 = t;
        double r1092284 = r1092282 - r1092283;
        double r1092285 = a;
        double r1092286 = r1092285 - r1092283;
        double r1092287 = r1092284 / r1092286;
        double r1092288 = r1092281 * r1092287;
        double r1092289 = x;
        double r1092290 = r1092288 + r1092289;
        return r1092290;
}

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.1
Herbie1.2
\[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. Simplified2.9

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

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

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

    \[\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 2020025 +o rules:numerics
(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))))