
(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 7 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 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
(if (<= y -2.7e-34)
(- 1.0 (/ x y))
(if (<= y -2.2e-225)
(/ (- x y) z)
(if (<= y 5.2e+143) (/ x (- z y)) (/ y (- y z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.7e-34) {
tmp = 1.0 - (x / y);
} else if (y <= -2.2e-225) {
tmp = (x - y) / z;
} else if (y <= 5.2e+143) {
tmp = x / (z - y);
} else {
tmp = y / (y - 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 <= (-2.7d-34)) then
tmp = 1.0d0 - (x / y)
else if (y <= (-2.2d-225)) then
tmp = (x - y) / z
else if (y <= 5.2d+143) then
tmp = x / (z - y)
else
tmp = y / (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.7e-34) {
tmp = 1.0 - (x / y);
} else if (y <= -2.2e-225) {
tmp = (x - y) / z;
} else if (y <= 5.2e+143) {
tmp = x / (z - y);
} else {
tmp = y / (y - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.7e-34: tmp = 1.0 - (x / y) elif y <= -2.2e-225: tmp = (x - y) / z elif y <= 5.2e+143: tmp = x / (z - y) else: tmp = y / (y - z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.7e-34) tmp = Float64(1.0 - Float64(x / y)); elseif (y <= -2.2e-225) tmp = Float64(Float64(x - y) / z); elseif (y <= 5.2e+143) tmp = Float64(x / Float64(z - y)); else tmp = Float64(y / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.7e-34) tmp = 1.0 - (x / y); elseif (y <= -2.2e-225) tmp = (x - y) / z; elseif (y <= 5.2e+143) tmp = x / (z - y); else tmp = y / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.7e-34], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.2e-225], N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 5.2e+143], N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-34}:\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-225}:\\
\;\;\;\;\frac{x - y}{z}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+143}:\\
\;\;\;\;\frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y - z}\\
\end{array}
\end{array}
if y < -2.70000000000000017e-34Initial program 100.0%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in z around 0
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6477.4%
Simplified77.4%
if -2.70000000000000017e-34 < y < -2.2e-225Initial program 100.0%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6482.9%
Simplified82.9%
if -2.2e-225 < y < 5.1999999999999998e143Initial program 100.0%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
div-invN/A
flip--N/A
clear-numN/A
frac-2negN/A
metadata-evalN/A
frac-timesN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f6484.4%
Simplified84.4%
if 5.1999999999999998e143 < y Initial program 99.9%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
--lowering--.f6496.1%
Simplified96.1%
(FPCore (x y z) :precision binary64 (if (<= y -7.5e-11) (- 1.0 (/ x y)) (if (<= y 5.2e+143) (/ x (- z y)) (/ y (- y z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.5e-11) {
tmp = 1.0 - (x / y);
} else if (y <= 5.2e+143) {
tmp = x / (z - y);
} else {
tmp = y / (y - 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.5d-11)) then
tmp = 1.0d0 - (x / y)
else if (y <= 5.2d+143) then
tmp = x / (z - y)
else
tmp = y / (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7.5e-11) {
tmp = 1.0 - (x / y);
} else if (y <= 5.2e+143) {
tmp = x / (z - y);
} else {
tmp = y / (y - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.5e-11: tmp = 1.0 - (x / y) elif y <= 5.2e+143: tmp = x / (z - y) else: tmp = y / (y - z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.5e-11) tmp = Float64(1.0 - Float64(x / y)); elseif (y <= 5.2e+143) tmp = Float64(x / Float64(z - y)); else tmp = Float64(y / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.5e-11) tmp = 1.0 - (x / y); elseif (y <= 5.2e+143) tmp = x / (z - y); else tmp = y / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.5e-11], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+143], N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-11}:\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+143}:\\
\;\;\;\;\frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y - z}\\
\end{array}
\end{array}
if y < -7.5e-11Initial program 100.0%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in z around 0
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6478.4%
Simplified78.4%
if -7.5e-11 < y < 5.1999999999999998e143Initial program 100.0%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
div-invN/A
flip--N/A
clear-numN/A
frac-2negN/A
metadata-evalN/A
frac-timesN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f6480.2%
Simplified80.2%
if 5.1999999999999998e143 < y Initial program 99.9%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
--lowering--.f6496.1%
Simplified96.1%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- 1.0 (/ x y)))) (if (<= y -2.1e-11) t_0 (if (<= y 1.15e+130) (/ 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.1e-11) {
tmp = t_0;
} else if (y <= 1.15e+130) {
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.1d-11)) then
tmp = t_0
else if (y <= 1.15d+130) 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.1e-11) {
tmp = t_0;
} else if (y <= 1.15e+130) {
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.1e-11: tmp = t_0 elif y <= 1.15e+130: 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.1e-11) tmp = t_0; elseif (y <= 1.15e+130) 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.1e-11) tmp = t_0; elseif (y <= 1.15e+130) 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.1e-11], t$95$0, If[LessEqual[y, 1.15e+130], 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.1 \cdot 10^{-11}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+130}:\\
\;\;\;\;\frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -2.0999999999999999e-11 or 1.15000000000000011e130 < y Initial program 99.9%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in z around 0
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6479.0%
Simplified79.0%
if -2.0999999999999999e-11 < y < 1.15000000000000011e130Initial program 100.0%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
div-invN/A
flip--N/A
clear-numN/A
frac-2negN/A
metadata-evalN/A
frac-timesN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f6481.0%
Simplified81.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- 1.0 (/ x y)))) (if (<= y -2.3e-35) t_0 (if (<= y 1.35e-19) (/ x z) t_0))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (x / y);
double tmp;
if (y <= -2.3e-35) {
tmp = t_0;
} else if (y <= 1.35e-19) {
tmp = x / z;
} 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.3d-35)) then
tmp = t_0
else if (y <= 1.35d-19) then
tmp = x / z
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.3e-35) {
tmp = t_0;
} else if (y <= 1.35e-19) {
tmp = x / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (x / y) tmp = 0 if y <= -2.3e-35: tmp = t_0 elif y <= 1.35e-19: tmp = x / z 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.3e-35) tmp = t_0; elseif (y <= 1.35e-19) tmp = Float64(x / z); 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.3e-35) tmp = t_0; elseif (y <= 1.35e-19) tmp = x / z; 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.3e-35], t$95$0, If[LessEqual[y, 1.35e-19], N[(x / z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -2.2999999999999999e-35 or 1.35e-19 < y Initial program 99.9%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in z around 0
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6473.2%
Simplified73.2%
if -2.2999999999999999e-35 < y < 1.35e-19Initial program 100.0%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
/-lowering-/.f6477.4%
Simplified77.4%
(FPCore (x y z) :precision binary64 (if (<= y -5.3e-11) 1.0 (if (<= y 1.7e+71) (/ x z) 1.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.3e-11) {
tmp = 1.0;
} else if (y <= 1.7e+71) {
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 <= (-5.3d-11)) then
tmp = 1.0d0
else if (y <= 1.7d+71) 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 <= -5.3e-11) {
tmp = 1.0;
} else if (y <= 1.7e+71) {
tmp = x / z;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.3e-11: tmp = 1.0 elif y <= 1.7e+71: tmp = x / z else: tmp = 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.3e-11) tmp = 1.0; elseif (y <= 1.7e+71) tmp = Float64(x / z); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.3e-11) tmp = 1.0; elseif (y <= 1.7e+71) tmp = x / z; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.3e-11], 1.0, If[LessEqual[y, 1.7e+71], N[(x / z), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{-11}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+71}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -5.2999999999999998e-11 or 1.6999999999999999e71 < y Initial program 100.0%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
Simplified61.4%
if -5.2999999999999998e-11 < y < 1.6999999999999999e71Initial program 100.0%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
/-lowering-/.f6469.0%
Simplified69.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%
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
sub-negN/A
+-commutativeN/A
distribute-neg-outN/A
remove-double-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
Simplified34.4%
(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 2024149
(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)))