Average Error: 7.0 → 2.0
Time: 4.2s
Precision: 64
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\]
\[\frac{\frac{z}{t \cdot z - x} \cdot y + x}{\left(x + 1\right) \cdot 1} - \frac{\frac{x}{t \cdot z - x}}{x + 1}\]
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\frac{\frac{z}{t \cdot z - x} \cdot y + x}{\left(x + 1\right) \cdot 1} - \frac{\frac{x}{t \cdot z - x}}{x + 1}
double code(double x, double y, double z, double t) {
	return ((x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0));
}
double code(double x, double y, double z, double t) {
	return (((((z / ((t * z) - x)) * y) + x) / ((x + 1.0) * 1.0)) - ((x / ((t * z) - x)) / (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.0
Target0.2
Herbie2.0
\[\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}\]

Derivation

  1. Initial program 7.0

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

    \[\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.0

    \[\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.0

    \[\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.5

    \[\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.6

    \[\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.6

    \[\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.0

    \[\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. Final simplification2.0

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

Reproduce

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