?

Average Error: 0.0 → 0.0
Time: 13.9s
Precision: binary64
Cost: 448

?

\[\frac{x - y}{z - y} \]
\[\frac{x - y}{z - y} \]
(FPCore (x y z) :precision binary64 (/ (- x y) (- z y)))
(FPCore (x y z) :precision binary64 (/ (- x y) (- z y)))
double code(double x, double y, double z) {
	return (x - y) / (z - y);
}
double code(double x, double y, double z) {
	return (x - y) / (z - y);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x - y) / (z - y)
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x - y) / (z - y)
end function
public static double code(double x, double y, double z) {
	return (x - y) / (z - y);
}
public static double code(double x, double y, double z) {
	return (x - y) / (z - y);
}
def code(x, y, z):
	return (x - y) / (z - y)
def code(x, y, z):
	return (x - y) / (z - y)
function code(x, y, z)
	return Float64(Float64(x - y) / Float64(z - y))
end
function code(x, y, z)
	return Float64(Float64(x - y) / Float64(z - y))
end
function tmp = code(x, y, z)
	tmp = (x - y) / (z - y);
end
function tmp = code(x, y, z)
	tmp = (x - y) / (z - y);
end
code[x_, y_, z_] := N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\frac{x - y}{z - y}
\frac{x - y}{z - y}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[\frac{x}{z - y} - \frac{y}{z - y} \]

Derivation?

  1. Initial program 0.0

    \[\frac{x - y}{z - y} \]
  2. Final simplification0.0

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

Alternatives

Alternative 1
Error15.6
Cost844
\[\begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+69}:\\ \;\;\;\;\frac{y}{y - z}\\ \mathbf{elif}\;y \leq 15.2:\\ \;\;\;\;\frac{x}{z - y}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+44}:\\ \;\;\;\;\frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x - z}{y}\\ \end{array} \]
Alternative 2
Error15.6
Cost780
\[\begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+69}:\\ \;\;\;\;\frac{y}{y - z}\\ \mathbf{elif}\;y \leq 2400:\\ \;\;\;\;\frac{x}{z - y}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+49}:\\ \;\;\;\;\frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;-\left(\frac{x}{y} - 1\right)\\ \end{array} \]
Alternative 3
Error25.1
Cost720
\[\begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+69}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-8}:\\ \;\;\;\;-\frac{x}{y}\\ \mathbf{elif}\;y \leq -1.18 \cdot 10^{-15}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+40}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 4
Error15.5
Cost716
\[\begin{array}{l} t_0 := \frac{y}{y - z}\\ \mathbf{if}\;y \leq -1.62 \cdot 10^{+69}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 5.8:\\ \;\;\;\;\frac{x}{z - y}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+46}:\\ \;\;\;\;\frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error19.8
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+69}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{+48}:\\ \;\;\;\;\frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 6
Error15.5
Cost584
\[\begin{array}{l} t_0 := \frac{y}{y - z}\\ \mathbf{if}\;y \leq -2.15 \cdot 10^{+69}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+26}:\\ \;\;\;\;\frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error25.0
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -5.6 \cdot 10^{-16}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+37}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 8
Error41.3
Cost64
\[1 \]

Error

Reproduce?

herbie shell --seed 2023074 
(FPCore (x y z)
  :name "Graphics.Rasterific.Shading:$sgradientColorAt from Rasterific-0.6.1"
  :precision binary64

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

  (/ (- x y) (- z y)))