Average Error: 7.4 → 0.0
Time: 6.8s
Precision: binary64
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
\[\frac{x - \frac{x}{z \cdot t - x}}{x + 1} + \frac{\frac{y}{x + 1}}{t - \frac{x}{z}} \]
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\frac{x - \frac{x}{z \cdot t - x}}{x + 1} + \frac{\frac{y}{x + 1}}{t - \frac{x}{z}}
(FPCore (x y z t)
 :precision binary64
 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
(FPCore (x y z t)
 :precision binary64
 (+ (/ (- x (/ x (- (* z t) x))) (+ x 1.0)) (/ (/ y (+ x 1.0)) (- t (/ x z)))))
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 ((x - (x / ((z * t) - x))) / (x + 1.0)) + ((y / (x + 1.0)) / (t - (x / z)));
}

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.4
Target0.4
Herbie0.0
\[\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1} \]

Derivation

  1. Initial program 7.4

    \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
  2. Taylor expanded in y around 0 7.4

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{x + 1}, \frac{z}{t \cdot z - x}, \frac{x - \frac{x}{t \cdot z - x}}{x + 1}\right)} \]
  4. Applied clear-num_binary642.0

    \[\leadsto \mathsf{fma}\left(\frac{y}{x + 1}, \color{blue}{\frac{1}{\frac{t \cdot z - x}{z}}}, \frac{x - \frac{x}{t \cdot z - x}}{x + 1}\right) \]
  5. Taylor expanded in y around 0 7.4

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

    \[\leadsto \color{blue}{\frac{x - \frac{x}{z \cdot t - x}}{x + 1} + \frac{y}{\left(x + 1\right) \cdot \left(t - \frac{x}{z}\right)}} \]
  7. Applied associate-/r*_binary640.0

    \[\leadsto \frac{x - \frac{x}{z \cdot t - x}}{x + 1} + \color{blue}{\frac{\frac{y}{x + 1}}{t - \frac{x}{z}}} \]
  8. Simplified0.0

    \[\leadsto \frac{x - \frac{x}{z \cdot t - x}}{x + 1} + \frac{\color{blue}{\frac{y}{1 + x}}}{t - \frac{x}{z}} \]
  9. Final simplification0.0

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

Reproduce

herbie shell --seed 2022077 
(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.0))

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