
(FPCore (x y z) :precision binary64 (/ (- 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
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)
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
code[x_, y_, z_] := N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (- 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
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)
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
code[x_, y_, z_] := N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y}
\end{array}
(FPCore (x y z) :precision binary64 (+ (/ x (- z y)) (/ y (- y z))))
double code(double x, double y, double z) {
return (x / (z - y)) + (y / (y - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x / (z - y)) + (y / (y - z))
end function
public static double code(double x, double y, double z) {
return (x / (z - y)) + (y / (y - z));
}
def code(x, y, z): return (x / (z - y)) + (y / (y - z))
function code(x, y, z) return Float64(Float64(x / Float64(z - y)) + Float64(y / Float64(y - z))) end
function tmp = code(x, y, z) tmp = (x / (z - y)) + (y / (y - z)); end
code[x_, y_, z_] := N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] + N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z - y} + \frac{y}{y - z}
\end{array}
Initial program 100.0%
div-sub100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ x y))))
(if (<= y -2.45e+48)
(/ y (- y z))
(if (<= y -1.85e-7)
t_0
(if (<= y -3.7e-60)
(- (/ x z) (/ y z))
(if (<= y 2.1e-16) (/ x (- z y)) t_0))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (x / y);
double tmp;
if (y <= -2.45e+48) {
tmp = y / (y - z);
} else if (y <= -1.85e-7) {
tmp = t_0;
} else if (y <= -3.7e-60) {
tmp = (x / z) - (y / z);
} else if (y <= 2.1e-16) {
tmp = x / (z - y);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (x / y)
if (y <= (-2.45d+48)) then
tmp = y / (y - z)
else if (y <= (-1.85d-7)) then
tmp = t_0
else if (y <= (-3.7d-60)) then
tmp = (x / z) - (y / z)
else if (y <= 2.1d-16) then
tmp = x / (z - y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (x / y);
double tmp;
if (y <= -2.45e+48) {
tmp = y / (y - z);
} else if (y <= -1.85e-7) {
tmp = t_0;
} else if (y <= -3.7e-60) {
tmp = (x / z) - (y / z);
} else if (y <= 2.1e-16) {
tmp = x / (z - y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (x / y) tmp = 0 if y <= -2.45e+48: tmp = y / (y - z) elif y <= -1.85e-7: tmp = t_0 elif y <= -3.7e-60: tmp = (x / z) - (y / z) elif y <= 2.1e-16: tmp = x / (z - y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(x / y)) tmp = 0.0 if (y <= -2.45e+48) tmp = Float64(y / Float64(y - z)); elseif (y <= -1.85e-7) tmp = t_0; elseif (y <= -3.7e-60) tmp = Float64(Float64(x / z) - Float64(y / z)); elseif (y <= 2.1e-16) tmp = Float64(x / Float64(z - y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (x / y); tmp = 0.0; if (y <= -2.45e+48) tmp = y / (y - z); elseif (y <= -1.85e-7) tmp = t_0; elseif (y <= -3.7e-60) tmp = (x / z) - (y / z); elseif (y <= 2.1e-16) tmp = x / (z - y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.45e+48], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.85e-7], t$95$0, If[LessEqual[y, -3.7e-60], N[(N[(x / z), $MachinePrecision] - N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-16], N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
\mathbf{if}\;y \leq -2.45 \cdot 10^{+48}:\\
\;\;\;\;\frac{y}{y - z}\\
\mathbf{elif}\;y \leq -1.85 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{-60}:\\
\;\;\;\;\frac{x}{z} - \frac{y}{z}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -2.45000000000000015e48Initial program 100.0%
Taylor expanded in x around 0 87.1%
neg-mul-187.1%
distribute-neg-frac287.1%
sub-neg87.1%
+-commutative87.1%
distribute-neg-in87.1%
remove-double-neg87.1%
sub-neg87.1%
Simplified87.1%
if -2.45000000000000015e48 < y < -1.85000000000000002e-7 or 2.1000000000000001e-16 < y Initial program 100.0%
Taylor expanded in z around 0 83.0%
associate-*r/83.0%
neg-mul-183.0%
sub-neg83.0%
+-commutative83.0%
distribute-neg-in83.0%
remove-double-neg83.0%
sub-neg83.0%
div-sub83.0%
*-inverses83.0%
Simplified83.0%
if -1.85000000000000002e-7 < y < -3.70000000000000025e-60Initial program 100.0%
Taylor expanded in z around inf 93.1%
div-sub93.1%
Applied egg-rr93.1%
if -3.70000000000000025e-60 < y < 2.1000000000000001e-16Initial program 100.0%
Taylor expanded in x around inf 88.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ x y))))
(if (<= y -7.4e+50)
(/ y (- y z))
(if (<= y -1.16e-8)
t_0
(if (<= y -8.5e-60)
(/ (- x y) z)
(if (<= y 3.4e-13) (/ x (- z y)) t_0))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (x / y);
double tmp;
if (y <= -7.4e+50) {
tmp = y / (y - z);
} else if (y <= -1.16e-8) {
tmp = t_0;
} else if (y <= -8.5e-60) {
tmp = (x - y) / z;
} else if (y <= 3.4e-13) {
tmp = x / (z - y);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (x / y)
if (y <= (-7.4d+50)) then
tmp = y / (y - z)
else if (y <= (-1.16d-8)) then
tmp = t_0
else if (y <= (-8.5d-60)) then
tmp = (x - y) / z
else if (y <= 3.4d-13) then
tmp = x / (z - y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (x / y);
double tmp;
if (y <= -7.4e+50) {
tmp = y / (y - z);
} else if (y <= -1.16e-8) {
tmp = t_0;
} else if (y <= -8.5e-60) {
tmp = (x - y) / z;
} else if (y <= 3.4e-13) {
tmp = x / (z - y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (x / y) tmp = 0 if y <= -7.4e+50: tmp = y / (y - z) elif y <= -1.16e-8: tmp = t_0 elif y <= -8.5e-60: tmp = (x - y) / z elif y <= 3.4e-13: tmp = x / (z - y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(x / y)) tmp = 0.0 if (y <= -7.4e+50) tmp = Float64(y / Float64(y - z)); elseif (y <= -1.16e-8) tmp = t_0; elseif (y <= -8.5e-60) tmp = Float64(Float64(x - y) / z); elseif (y <= 3.4e-13) tmp = Float64(x / Float64(z - y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (x / y); tmp = 0.0; if (y <= -7.4e+50) tmp = y / (y - z); elseif (y <= -1.16e-8) tmp = t_0; elseif (y <= -8.5e-60) tmp = (x - y) / z; elseif (y <= 3.4e-13) tmp = x / (z - y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.4e+50], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.16e-8], t$95$0, If[LessEqual[y, -8.5e-60], N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 3.4e-13], N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
\mathbf{if}\;y \leq -7.4 \cdot 10^{+50}:\\
\;\;\;\;\frac{y}{y - z}\\
\mathbf{elif}\;y \leq -1.16 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-60}:\\
\;\;\;\;\frac{x - y}{z}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-13}:\\
\;\;\;\;\frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -7.4000000000000001e50Initial program 100.0%
Taylor expanded in x around 0 87.1%
neg-mul-187.1%
distribute-neg-frac287.1%
sub-neg87.1%
+-commutative87.1%
distribute-neg-in87.1%
remove-double-neg87.1%
sub-neg87.1%
Simplified87.1%
if -7.4000000000000001e50 < y < -1.15999999999999996e-8 or 3.40000000000000015e-13 < y Initial program 100.0%
Taylor expanded in z around 0 83.0%
associate-*r/83.0%
neg-mul-183.0%
sub-neg83.0%
+-commutative83.0%
distribute-neg-in83.0%
remove-double-neg83.0%
sub-neg83.0%
div-sub83.0%
*-inverses83.0%
Simplified83.0%
if -1.15999999999999996e-8 < y < -8.50000000000000044e-60Initial program 100.0%
Taylor expanded in z around inf 93.1%
if -8.50000000000000044e-60 < y < 3.40000000000000015e-13Initial program 100.0%
Taylor expanded in x around inf 88.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.1e-8) (not (<= y 3.3e-13))) (- 1.0 (/ x y)) (/ x (- z y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.1e-8) || !(y <= 3.3e-13)) {
tmp = 1.0 - (x / y);
} else {
tmp = x / (z - y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-4.1d-8)) .or. (.not. (y <= 3.3d-13))) then
tmp = 1.0d0 - (x / y)
else
tmp = x / (z - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4.1e-8) || !(y <= 3.3e-13)) {
tmp = 1.0 - (x / y);
} else {
tmp = x / (z - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.1e-8) or not (y <= 3.3e-13): tmp = 1.0 - (x / y) else: tmp = x / (z - y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.1e-8) || !(y <= 3.3e-13)) tmp = Float64(1.0 - Float64(x / y)); else tmp = Float64(x / Float64(z - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.1e-8) || ~((y <= 3.3e-13))) tmp = 1.0 - (x / y); else tmp = x / (z - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.1e-8], N[Not[LessEqual[y, 3.3e-13]], $MachinePrecision]], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-8} \lor \neg \left(y \leq 3.3 \cdot 10^{-13}\right):\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z - y}\\
\end{array}
\end{array}
if y < -4.10000000000000032e-8 or 3.3000000000000001e-13 < y Initial program 100.0%
Taylor expanded in z around 0 81.5%
associate-*r/81.5%
neg-mul-181.5%
sub-neg81.5%
+-commutative81.5%
distribute-neg-in81.5%
remove-double-neg81.5%
sub-neg81.5%
div-sub81.5%
*-inverses81.5%
Simplified81.5%
if -4.10000000000000032e-8 < y < 3.3000000000000001e-13Initial program 100.0%
Taylor expanded in x around inf 83.6%
Final simplification82.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -7.1e-9) (not (<= y 3.3e-18))) (- 1.0 (/ x y)) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -7.1e-9) || !(y <= 3.3e-18)) {
tmp = 1.0 - (x / y);
} else {
tmp = x / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-7.1d-9)) .or. (.not. (y <= 3.3d-18))) then
tmp = 1.0d0 - (x / y)
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -7.1e-9) || !(y <= 3.3e-18)) {
tmp = 1.0 - (x / y);
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -7.1e-9) or not (y <= 3.3e-18): tmp = 1.0 - (x / y) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -7.1e-9) || !(y <= 3.3e-18)) tmp = Float64(1.0 - Float64(x / y)); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -7.1e-9) || ~((y <= 3.3e-18))) tmp = 1.0 - (x / y); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -7.1e-9], N[Not[LessEqual[y, 3.3e-18]], $MachinePrecision]], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.1 \cdot 10^{-9} \lor \neg \left(y \leq 3.3 \cdot 10^{-18}\right):\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -7.09999999999999988e-9 or 3.3000000000000002e-18 < y Initial program 100.0%
Taylor expanded in z around 0 81.5%
associate-*r/81.5%
neg-mul-181.5%
sub-neg81.5%
+-commutative81.5%
distribute-neg-in81.5%
remove-double-neg81.5%
sub-neg81.5%
div-sub81.5%
*-inverses81.5%
Simplified81.5%
if -7.09999999999999988e-9 < y < 3.3000000000000002e-18Initial program 100.0%
Taylor expanded in y around 0 72.6%
Final simplification77.0%
(FPCore (x y z) :precision binary64 (if (<= y -2.8e+48) (/ y (- y z)) (if (<= y 8.5e-11) (/ x (- z y)) (- 1.0 (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.8e+48) {
tmp = y / (y - z);
} else if (y <= 8.5e-11) {
tmp = x / (z - y);
} else {
tmp = 1.0 - (x / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2.8d+48)) then
tmp = y / (y - z)
else if (y <= 8.5d-11) then
tmp = x / (z - y)
else
tmp = 1.0d0 - (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.8e+48) {
tmp = y / (y - z);
} else if (y <= 8.5e-11) {
tmp = x / (z - y);
} else {
tmp = 1.0 - (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.8e+48: tmp = y / (y - z) elif y <= 8.5e-11: tmp = x / (z - y) else: tmp = 1.0 - (x / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.8e+48) tmp = Float64(y / Float64(y - z)); elseif (y <= 8.5e-11) tmp = Float64(x / Float64(z - y)); else tmp = Float64(1.0 - Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.8e+48) tmp = y / (y - z); elseif (y <= 8.5e-11) tmp = x / (z - y); else tmp = 1.0 - (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.8e+48], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e-11], N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+48}:\\
\;\;\;\;\frac{y}{y - z}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y}\\
\end{array}
\end{array}
if y < -2.80000000000000012e48Initial program 100.0%
Taylor expanded in x around 0 87.1%
neg-mul-187.1%
distribute-neg-frac287.1%
sub-neg87.1%
+-commutative87.1%
distribute-neg-in87.1%
remove-double-neg87.1%
sub-neg87.1%
Simplified87.1%
if -2.80000000000000012e48 < y < 8.50000000000000037e-11Initial program 100.0%
Taylor expanded in x around inf 82.8%
if 8.50000000000000037e-11 < y Initial program 100.0%
Taylor expanded in z around 0 82.0%
associate-*r/82.0%
neg-mul-182.0%
sub-neg82.0%
+-commutative82.0%
distribute-neg-in82.0%
remove-double-neg82.0%
sub-neg82.0%
div-sub82.0%
*-inverses82.0%
Simplified82.0%
(FPCore (x y z) :precision binary64 (if (<= y -1.72e-6) 1.0 (if (<= y 3e-15) (/ x z) 1.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.72e-6) {
tmp = 1.0;
} else if (y <= 3e-15) {
tmp = x / z;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.72d-6)) then
tmp = 1.0d0
else if (y <= 3d-15) then
tmp = x / z
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.72e-6) {
tmp = 1.0;
} else if (y <= 3e-15) {
tmp = x / z;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.72e-6: tmp = 1.0 elif y <= 3e-15: tmp = x / z else: tmp = 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.72e-6) tmp = 1.0; elseif (y <= 3e-15) tmp = Float64(x / z); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.72e-6) tmp = 1.0; elseif (y <= 3e-15) tmp = x / z; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.72e-6], 1.0, If[LessEqual[y, 3e-15], N[(x / z), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.72 \cdot 10^{-6}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-15}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.72e-6 or 3e-15 < y Initial program 100.0%
Taylor expanded in y around inf 64.2%
if -1.72e-6 < y < 3e-15Initial program 100.0%
Taylor expanded in y around 0 72.6%
(FPCore (x y z) :precision binary64 (/ (- 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
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)
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
code[x_, y_, z_] := N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y}
\end{array}
Initial program 100.0%
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
Taylor expanded in y around inf 35.6%
(FPCore (x y z) :precision binary64 (- (/ x (- z y)) (/ y (- z y))))
double code(double x, double y, double z) {
return (x / (z - y)) - (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 / (z - y)) - (y / (z - y))
end function
public static double code(double x, double y, double z) {
return (x / (z - y)) - (y / (z - y));
}
def code(x, y, z): return (x / (z - y)) - (y / (z - y))
function code(x, y, z) return Float64(Float64(x / Float64(z - y)) - Float64(y / Float64(z - y))) end
function tmp = code(x, y, z) tmp = (x / (z - y)) - (y / (z - y)); end
code[x_, y_, z_] := N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] - N[(y / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z - y} - \frac{y}{z - y}
\end{array}
herbie shell --seed 2024180
(FPCore (x y z)
:name "Graphics.Rasterific.Shading:$sgradientColorAt from Rasterific-0.6.1"
:precision binary64
:alt
(! :herbie-platform default (- (/ x (- z y)) (/ y (- z y))))
(/ (- x y) (- z y)))