Average Error: 7.4 → 0.1
Time: 10.6s
Precision: binary64
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\]
\[\frac{x - \frac{x}{t \cdot z - x}}{x + 1} + \frac{1}{t - \frac{x}{z}} \cdot \frac{y}{x + 1}\]
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\frac{x - \frac{x}{t \cdot z - x}}{x + 1} + \frac{1}{t - \frac{x}{z}} \cdot \frac{y}{x + 1}
(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 (- (* t z) x))) (+ x 1.0))
  (* (/ 1.0 (- t (/ x z))) (/ y (+ x 1.0)))))
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 / ((t * z) - x))) / (x + 1.0)) + ((1.0 / (t - (x / z))) * (y / (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.4
Target0.4
Herbie0.1
\[\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 around 0 7.4

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

    \[\leadsto \color{blue}{\frac{x - \frac{x}{t \cdot z - x}}{x + 1} + \frac{z \cdot y}{\left(t \cdot z - x\right) \cdot \left(x + 1\right)}}\]
  4. Using strategy rm
  5. Applied times-frac_binary64_167932.0

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

    \[\leadsto \frac{x - \frac{x}{t \cdot z - x}}{x + 1} + \color{blue}{\frac{z}{z \cdot t - x}} \cdot \frac{y}{x + 1}\]
  7. Using strategy rm
  8. Applied clear-num_binary64_167862.0

    \[\leadsto \frac{x - \frac{x}{t \cdot z - x}}{x + 1} + \color{blue}{\frac{1}{\frac{z \cdot t - x}{z}}} \cdot \frac{y}{x + 1}\]
  9. Taylor expanded around 0 0.1

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

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

Reproduce

herbie shell --seed 2021040 
(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)))