Average Error: 7.2 → 0.1
Time: 4.8s
Precision: binary64
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
\[\frac{y}{\left(x + 1\right) \cdot \left(t - \frac{x}{z}\right)} + \frac{x - \frac{x}{t \cdot z - x}}{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
 (+ (/ y (* (+ x 1.0) (- t (/ x z)))) (/ (- x (/ x (- (* t z) x))) (+ 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 (y / ((x + 1.0) * (t - (x / z)))) + ((x - (x / ((t * z) - x))) / (x + 1.0));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (y / ((x + 1.0d0) * (t - (x / z)))) + ((x - (x / ((t * z) - x))) / (x + 1.0d0))
end function
public static double code(double x, double y, double z, double t) {
	return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
public static double code(double x, double y, double z, double t) {
	return (y / ((x + 1.0) * (t - (x / z)))) + ((x - (x / ((t * z) - x))) / (x + 1.0));
}
def code(x, y, z, t):
	return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
def code(x, y, z, t):
	return (y / ((x + 1.0) * (t - (x / z)))) + ((x - (x / ((t * z) - x))) / (x + 1.0))
function code(x, y, z, t)
	return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0))
end
function code(x, y, z, t)
	return Float64(Float64(y / Float64(Float64(x + 1.0) * Float64(t - Float64(x / z)))) + Float64(Float64(x - Float64(x / Float64(Float64(t * z) - x))) / Float64(x + 1.0)))
end
function tmp = code(x, y, z, t)
	tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
end
function tmp = code(x, y, z, t)
	tmp = (y / ((x + 1.0) * (t - (x / z)))) + ((x - (x / ((t * z) - x))) / (x + 1.0));
end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\frac{y}{\left(x + 1\right) \cdot \left(t - \frac{x}{z}\right)} + \frac{x - \frac{x}{t \cdot z - x}}{x + 1}

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.2
Target0.3
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.2

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

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

    \[\leadsto \frac{x + \color{blue}{\left(\frac{y}{\frac{t \cdot z - x}{z}} - \frac{x}{t \cdot z - x}\right)}}{x + 1} \]
  4. Taylor expanded in t around 0 0.3

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

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

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

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

Reproduce

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