Average Error: 16.9 → 7.3
Time: 4.4s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[x + \left(y - \frac{y}{\frac{a - t}{z - t}}\right)\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
x + \left(y - \frac{y}{\frac{a - t}{z - t}}\right)
double code(double x, double y, double z, double t, double a) {
	return ((double) (((double) (x + y)) - ((double) (((double) (((double) (z - t)) * y)) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (y - ((double) (y / ((double) (((double) (a - t)) / ((double) (z - t))))))))));
}

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

Original16.9
Target8.5
Herbie7.3
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt -1.3664970889390727 \cdot 10^{-7}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt 1.47542934445772333 \cdot 10^{-239}:\\ \;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \end{array}\]

Derivation

  1. Initial program 16.9

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

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

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

    \[\leadsto \left(x + y\right) - \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a - t}}\]
  6. Simplified11.9

    \[\leadsto \left(x + y\right) - \color{blue}{y} \cdot \frac{z - t}{a - t}\]
  7. Using strategy rm
  8. Applied associate--l+7.5

    \[\leadsto \color{blue}{x + \left(y - y \cdot \frac{z - t}{a - t}\right)}\]
  9. Using strategy rm
  10. Applied clear-num7.5

    \[\leadsto x + \left(y - y \cdot \color{blue}{\frac{1}{\frac{a - t}{z - t}}}\right)\]
  11. Applied un-div-inv7.3

    \[\leadsto x + \left(y - \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\right)\]
  12. Final simplification7.3

    \[\leadsto x + \left(y - \frac{y}{\frac{a - t}{z - t}}\right)\]

Reproduce

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

  :herbie-target
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y))))

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