Average Error: 7.6 → 2.2
Time: 3.8s
Precision: 64
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\]
\[\frac{1}{\frac{x + 1}{\mathsf{fma}\left(\frac{z}{t \cdot z - x}, y, x\right)}} - \frac{\frac{x}{t \cdot z - x}}{x + 1}\]
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\frac{1}{\frac{x + 1}{\mathsf{fma}\left(\frac{z}{t \cdot z - x}, y, x\right)}} - \frac{\frac{x}{t \cdot z - x}}{x + 1}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x + ((double) (((double) (((double) (y * z)) - x)) / ((double) (((double) (t * z)) - x)))))) / ((double) (x + 1.0))));
}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (1.0 / ((double) (((double) (x + 1.0)) / ((double) fma(((double) (z / ((double) (((double) (t * z)) - x)))), y, x)))))) - ((double) (((double) (x / ((double) (((double) (t * z)) - x)))) / ((double) (x + 1.0))))));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.6
Target0.3
Herbie2.2
\[\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}\]

Derivation

  1. Initial program 7.6

    \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\]
  2. Using strategy rm
  3. Applied div-sub7.6

    \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{t \cdot z - x} - \frac{x}{t \cdot z - x}\right)}}{x + 1}\]
  4. Applied associate-+r-7.6

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

    \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z}{t \cdot z - x}}{x + 1} - \frac{\frac{x}{t \cdot z - x}}{x + 1}}\]
  6. Simplified4.4

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{y}{t \cdot z - x}, z, x\right)}{\left(x + 1\right) \cdot 1}} - \frac{\frac{x}{t \cdot z - x}}{x + 1}\]
  7. Using strategy rm
  8. Applied clear-num4.5

    \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{1}{\frac{t \cdot z - x}{y}}}, z, x\right)}{\left(x + 1\right) \cdot 1} - \frac{\frac{x}{t \cdot z - x}}{x + 1}\]
  9. Using strategy rm
  10. Applied fma-udef4.5

    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{t \cdot z - x}{y}} \cdot z + x}}{\left(x + 1\right) \cdot 1} - \frac{\frac{x}{t \cdot z - x}}{x + 1}\]
  11. Simplified2.1

    \[\leadsto \frac{\color{blue}{\frac{z}{t \cdot z - x} \cdot y} + x}{\left(x + 1\right) \cdot 1} - \frac{\frac{x}{t \cdot z - x}}{x + 1}\]
  12. Using strategy rm
  13. Applied clear-num2.2

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

    \[\leadsto \frac{1}{\color{blue}{\frac{x + 1}{\mathsf{fma}\left(\frac{z}{t \cdot z - x}, y, x\right)}}} - \frac{\frac{x}{t \cdot z - x}}{x + 1}\]
  15. Final simplification2.2

    \[\leadsto \frac{1}{\frac{x + 1}{\mathsf{fma}\left(\frac{z}{t \cdot z - x}, y, x\right)}} - \frac{\frac{x}{t \cdot z - x}}{x + 1}\]

Reproduce

herbie shell --seed 2020121 +o rules:numerics
(FPCore (x y z t)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, A"
  :precision binary64

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

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