Average Error: 11.7 → 2.2
Time: 4.2s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z} \]
\[\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}} \]
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t) :precision binary64 (/ x (- (/ t (- y z)) (/ z (- y z)))))
double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
double code(double x, double y, double z, double t) {
	return x / ((t / (y - z)) - (z / (y - z)));
}
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)) / (t - z)
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 = x / ((t / (y - z)) - (z / (y - z)))
end function
public static double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
public static double code(double x, double y, double z, double t) {
	return x / ((t / (y - z)) - (z / (y - z)));
}
def code(x, y, z, t):
	return (x * (y - z)) / (t - z)
def code(x, y, z, t):
	return x / ((t / (y - z)) - (z / (y - z)))
function code(x, y, z, t)
	return Float64(Float64(x * Float64(y - z)) / Float64(t - z))
end
function code(x, y, z, t)
	return Float64(x / Float64(Float64(t / Float64(y - z)) - Float64(z / Float64(y - z))))
end
function tmp = code(x, y, z, t)
	tmp = (x * (y - z)) / (t - z);
end
function tmp = code(x, y, z, t)
	tmp = x / ((t / (y - z)) - (z / (y - z)));
end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(x / N[(N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision] - N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot \left(y - z\right)}{t - z}
\frac{x}{\frac{t}{y - z} - \frac{z}{y - 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

Original11.7
Target2.2
Herbie2.2
\[\frac{x}{\frac{t - z}{y - z}} \]

Derivation

  1. Initial program 11.7

    \[\frac{x \cdot \left(y - z\right)}{t - z} \]
  2. Simplified2.2

    \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
  3. Taylor expanded in x around 0 11.7

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

    \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
  5. Taylor expanded in t around 0 2.2

    \[\leadsto \frac{x}{\color{blue}{\frac{t}{y - z} - \frac{z}{y - z}}} \]
  6. Final simplification2.2

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

Reproduce

herbie shell --seed 2022150 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (/ x (/ (- t z) (- y z)))

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