Average Error: 11.0 → 1.2
Time: 4.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 code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
	return ((double) (((double) (y * ((double) (((double) (z - t)) / ((double) (a - t)))))) + x));
}

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.1
Herbie1.2
\[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 add-cube-cbrt3.5

    \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{a - t}, z - t, x\right)\]
  5. Applied associate-/l*3.5

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

    \[\leadsto \color{blue}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\frac{a - t}{\sqrt[3]{y}}} \cdot \left(z - t\right) + x}\]
  8. Simplified11.0

    \[\leadsto \color{blue}{\frac{\left(z - t\right) \cdot y}{a - t}} + x\]
  9. Using strategy rm
  10. Applied *-un-lft-identity11.0

    \[\leadsto \frac{\left(z - t\right) \cdot y}{\color{blue}{1 \cdot \left(a - t\right)}} + x\]
  11. Applied *-commutative11.0

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

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

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

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

Reproduce

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