
(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 10 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%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ x y))))
(if (<= y -1.1e+47)
t_0
(if (<= y -64000000.0)
(- (/ y z))
(if (or (<= y -1.02e-60)
(not
(or (<= y 1.2e-200)
(and (not (<= y 1.15e-107)) (<= y 2.9e-74)))))
t_0
(/ x z))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (x / y);
double tmp;
if (y <= -1.1e+47) {
tmp = t_0;
} else if (y <= -64000000.0) {
tmp = -(y / z);
} else if ((y <= -1.02e-60) || !((y <= 1.2e-200) || (!(y <= 1.15e-107) && (y <= 2.9e-74)))) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (x / y)
if (y <= (-1.1d+47)) then
tmp = t_0
else if (y <= (-64000000.0d0)) then
tmp = -(y / z)
else if ((y <= (-1.02d-60)) .or. (.not. (y <= 1.2d-200) .or. (.not. (y <= 1.15d-107)) .and. (y <= 2.9d-74))) then
tmp = t_0
else
tmp = x / z
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 <= -1.1e+47) {
tmp = t_0;
} else if (y <= -64000000.0) {
tmp = -(y / z);
} else if ((y <= -1.02e-60) || !((y <= 1.2e-200) || (!(y <= 1.15e-107) && (y <= 2.9e-74)))) {
tmp = t_0;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (x / y) tmp = 0 if y <= -1.1e+47: tmp = t_0 elif y <= -64000000.0: tmp = -(y / z) elif (y <= -1.02e-60) or not ((y <= 1.2e-200) or (not (y <= 1.15e-107) and (y <= 2.9e-74))): tmp = t_0 else: tmp = x / z return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(x / y)) tmp = 0.0 if (y <= -1.1e+47) tmp = t_0; elseif (y <= -64000000.0) tmp = Float64(-Float64(y / z)); elseif ((y <= -1.02e-60) || !((y <= 1.2e-200) || (!(y <= 1.15e-107) && (y <= 2.9e-74)))) tmp = t_0; else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (x / y); tmp = 0.0; if (y <= -1.1e+47) tmp = t_0; elseif (y <= -64000000.0) tmp = -(y / z); elseif ((y <= -1.02e-60) || ~(((y <= 1.2e-200) || (~((y <= 1.15e-107)) && (y <= 2.9e-74))))) tmp = t_0; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e+47], t$95$0, If[LessEqual[y, -64000000.0], (-N[(y / z), $MachinePrecision]), If[Or[LessEqual[y, -1.02e-60], N[Not[Or[LessEqual[y, 1.2e-200], And[N[Not[LessEqual[y, 1.15e-107]], $MachinePrecision], LessEqual[y, 2.9e-74]]]], $MachinePrecision]], t$95$0, N[(x / z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{+47}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -64000000:\\
\;\;\;\;-\frac{y}{z}\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{-60} \lor \neg \left(y \leq 1.2 \cdot 10^{-200} \lor \neg \left(y \leq 1.15 \cdot 10^{-107}\right) \land y \leq 2.9 \cdot 10^{-74}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -1.1e47 or -6.4e7 < y < -1.01999999999999994e-60 or 1.20000000000000001e-200 < y < 1.15000000000000002e-107 or 2.9e-74 < y Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in z around 0 72.3%
div-sub72.3%
*-inverses72.3%
Simplified72.3%
if -1.1e47 < y < -6.4e7Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in x around 0 81.0%
Taylor expanded in y around 0 71.1%
associate-*r/71.1%
neg-mul-171.1%
Simplified71.1%
if -1.01999999999999994e-60 < y < 1.20000000000000001e-200 or 1.15000000000000002e-107 < y < 2.9e-74Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 81.6%
Final simplification75.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (/ x y))))
(if (<= y -7.6e+128)
1.0
(if (<= y -2.3e+51)
t_0
(if (<= y -3.6e-13)
1.0
(if (<= y -1.16e-56)
t_0
(if (<= y 82.0) (/ x z) (if (<= y 7.5e+167) t_0 1.0))))))))
double code(double x, double y, double z) {
double t_0 = -(x / y);
double tmp;
if (y <= -7.6e+128) {
tmp = 1.0;
} else if (y <= -2.3e+51) {
tmp = t_0;
} else if (y <= -3.6e-13) {
tmp = 1.0;
} else if (y <= -1.16e-56) {
tmp = t_0;
} else if (y <= 82.0) {
tmp = x / z;
} else if (y <= 7.5e+167) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = -(x / y)
if (y <= (-7.6d+128)) then
tmp = 1.0d0
else if (y <= (-2.3d+51)) then
tmp = t_0
else if (y <= (-3.6d-13)) then
tmp = 1.0d0
else if (y <= (-1.16d-56)) then
tmp = t_0
else if (y <= 82.0d0) then
tmp = x / z
else if (y <= 7.5d+167) then
tmp = t_0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -(x / y);
double tmp;
if (y <= -7.6e+128) {
tmp = 1.0;
} else if (y <= -2.3e+51) {
tmp = t_0;
} else if (y <= -3.6e-13) {
tmp = 1.0;
} else if (y <= -1.16e-56) {
tmp = t_0;
} else if (y <= 82.0) {
tmp = x / z;
} else if (y <= 7.5e+167) {
tmp = t_0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z): t_0 = -(x / y) tmp = 0 if y <= -7.6e+128: tmp = 1.0 elif y <= -2.3e+51: tmp = t_0 elif y <= -3.6e-13: tmp = 1.0 elif y <= -1.16e-56: tmp = t_0 elif y <= 82.0: tmp = x / z elif y <= 7.5e+167: tmp = t_0 else: tmp = 1.0 return tmp
function code(x, y, z) t_0 = Float64(-Float64(x / y)) tmp = 0.0 if (y <= -7.6e+128) tmp = 1.0; elseif (y <= -2.3e+51) tmp = t_0; elseif (y <= -3.6e-13) tmp = 1.0; elseif (y <= -1.16e-56) tmp = t_0; elseif (y <= 82.0) tmp = Float64(x / z); elseif (y <= 7.5e+167) tmp = t_0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -(x / y); tmp = 0.0; if (y <= -7.6e+128) tmp = 1.0; elseif (y <= -2.3e+51) tmp = t_0; elseif (y <= -3.6e-13) tmp = 1.0; elseif (y <= -1.16e-56) tmp = t_0; elseif (y <= 82.0) tmp = x / z; elseif (y <= 7.5e+167) tmp = t_0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = (-N[(x / y), $MachinePrecision])}, If[LessEqual[y, -7.6e+128], 1.0, If[LessEqual[y, -2.3e+51], t$95$0, If[LessEqual[y, -3.6e-13], 1.0, If[LessEqual[y, -1.16e-56], t$95$0, If[LessEqual[y, 82.0], N[(x / z), $MachinePrecision], If[LessEqual[y, 7.5e+167], t$95$0, 1.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{y}\\
\mathbf{if}\;y \leq -7.6 \cdot 10^{+128}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{+51}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{-13}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -1.16 \cdot 10^{-56}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 82:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+167}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -7.5999999999999998e128 or -2.30000000000000005e51 < y < -3.5999999999999998e-13 or 7.4999999999999995e167 < y Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around inf 64.6%
if -7.5999999999999998e128 < y < -2.30000000000000005e51 or -3.5999999999999998e-13 < y < -1.1600000000000001e-56 or 82 < y < 7.4999999999999995e167Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in z around 0 70.0%
div-sub70.0%
*-inverses70.0%
Simplified70.0%
Taylor expanded in x around inf 52.3%
mul-1-neg52.3%
distribute-frac-neg52.3%
Simplified52.3%
if -1.1600000000000001e-56 < y < 82Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 70.0%
Final simplification64.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (/ x y))))
(if (<= y -7.6e+128)
1.0
(if (<= y -2.25e+50)
t_0
(if (<= y -0.235)
(- (/ y z))
(if (<= y -1.1e-56)
t_0
(if (<= y 5.0) (/ x z) (if (<= y 7.5e+167) t_0 1.0))))))))
double code(double x, double y, double z) {
double t_0 = -(x / y);
double tmp;
if (y <= -7.6e+128) {
tmp = 1.0;
} else if (y <= -2.25e+50) {
tmp = t_0;
} else if (y <= -0.235) {
tmp = -(y / z);
} else if (y <= -1.1e-56) {
tmp = t_0;
} else if (y <= 5.0) {
tmp = x / z;
} else if (y <= 7.5e+167) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = -(x / y)
if (y <= (-7.6d+128)) then
tmp = 1.0d0
else if (y <= (-2.25d+50)) then
tmp = t_0
else if (y <= (-0.235d0)) then
tmp = -(y / z)
else if (y <= (-1.1d-56)) then
tmp = t_0
else if (y <= 5.0d0) then
tmp = x / z
else if (y <= 7.5d+167) then
tmp = t_0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -(x / y);
double tmp;
if (y <= -7.6e+128) {
tmp = 1.0;
} else if (y <= -2.25e+50) {
tmp = t_0;
} else if (y <= -0.235) {
tmp = -(y / z);
} else if (y <= -1.1e-56) {
tmp = t_0;
} else if (y <= 5.0) {
tmp = x / z;
} else if (y <= 7.5e+167) {
tmp = t_0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z): t_0 = -(x / y) tmp = 0 if y <= -7.6e+128: tmp = 1.0 elif y <= -2.25e+50: tmp = t_0 elif y <= -0.235: tmp = -(y / z) elif y <= -1.1e-56: tmp = t_0 elif y <= 5.0: tmp = x / z elif y <= 7.5e+167: tmp = t_0 else: tmp = 1.0 return tmp
function code(x, y, z) t_0 = Float64(-Float64(x / y)) tmp = 0.0 if (y <= -7.6e+128) tmp = 1.0; elseif (y <= -2.25e+50) tmp = t_0; elseif (y <= -0.235) tmp = Float64(-Float64(y / z)); elseif (y <= -1.1e-56) tmp = t_0; elseif (y <= 5.0) tmp = Float64(x / z); elseif (y <= 7.5e+167) tmp = t_0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -(x / y); tmp = 0.0; if (y <= -7.6e+128) tmp = 1.0; elseif (y <= -2.25e+50) tmp = t_0; elseif (y <= -0.235) tmp = -(y / z); elseif (y <= -1.1e-56) tmp = t_0; elseif (y <= 5.0) tmp = x / z; elseif (y <= 7.5e+167) tmp = t_0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = (-N[(x / y), $MachinePrecision])}, If[LessEqual[y, -7.6e+128], 1.0, If[LessEqual[y, -2.25e+50], t$95$0, If[LessEqual[y, -0.235], (-N[(y / z), $MachinePrecision]), If[LessEqual[y, -1.1e-56], t$95$0, If[LessEqual[y, 5.0], N[(x / z), $MachinePrecision], If[LessEqual[y, 7.5e+167], t$95$0, 1.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{y}\\
\mathbf{if}\;y \leq -7.6 \cdot 10^{+128}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{+50}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -0.235:\\
\;\;\;\;-\frac{y}{z}\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-56}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+167}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -7.5999999999999998e128 or 7.4999999999999995e167 < y Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around inf 73.5%
if -7.5999999999999998e128 < y < -2.25000000000000007e50 or -0.23499999999999999 < y < -1.10000000000000002e-56 or 5 < y < 7.4999999999999995e167Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in z around 0 71.6%
div-sub71.6%
*-inverses71.6%
Simplified71.6%
Taylor expanded in x around inf 49.8%
mul-1-neg49.8%
distribute-frac-neg49.8%
Simplified49.8%
if -2.25000000000000007e50 < y < -0.23499999999999999Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in x around 0 79.7%
Taylor expanded in y around 0 58.6%
associate-*r/58.6%
neg-mul-158.6%
Simplified58.6%
if -1.10000000000000002e-56 < y < 5Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 70.0%
Final simplification65.5%
(FPCore (x y z)
:precision binary64
(if (<= y -0.00175)
(/ y (- y z))
(if (or (<= y -2.9e-60)
(and (not (<= y 1.2e-200))
(or (<= y 7.2e-108) (not (<= y 2.2e-74)))))
(- 1.0 (/ x y))
(/ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -0.00175) {
tmp = y / (y - z);
} else if ((y <= -2.9e-60) || (!(y <= 1.2e-200) && ((y <= 7.2e-108) || !(y <= 2.2e-74)))) {
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 <= (-0.00175d0)) then
tmp = y / (y - z)
else if ((y <= (-2.9d-60)) .or. (.not. (y <= 1.2d-200)) .and. (y <= 7.2d-108) .or. (.not. (y <= 2.2d-74))) 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 <= -0.00175) {
tmp = y / (y - z);
} else if ((y <= -2.9e-60) || (!(y <= 1.2e-200) && ((y <= 7.2e-108) || !(y <= 2.2e-74)))) {
tmp = 1.0 - (x / y);
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -0.00175: tmp = y / (y - z) elif (y <= -2.9e-60) or (not (y <= 1.2e-200) and ((y <= 7.2e-108) or not (y <= 2.2e-74))): tmp = 1.0 - (x / y) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -0.00175) tmp = Float64(y / Float64(y - z)); elseif ((y <= -2.9e-60) || (!(y <= 1.2e-200) && ((y <= 7.2e-108) || !(y <= 2.2e-74)))) 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 <= -0.00175) tmp = y / (y - z); elseif ((y <= -2.9e-60) || (~((y <= 1.2e-200)) && ((y <= 7.2e-108) || ~((y <= 2.2e-74))))) tmp = 1.0 - (x / y); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -0.00175], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -2.9e-60], And[N[Not[LessEqual[y, 1.2e-200]], $MachinePrecision], Or[LessEqual[y, 7.2e-108], N[Not[LessEqual[y, 2.2e-74]], $MachinePrecision]]]], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00175:\\
\;\;\;\;\frac{y}{y - z}\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-60} \lor \neg \left(y \leq 1.2 \cdot 10^{-200}\right) \land \left(y \leq 7.2 \cdot 10^{-108} \lor \neg \left(y \leq 2.2 \cdot 10^{-74}\right)\right):\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -0.00175000000000000004Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in x around 0 77.3%
if -0.00175000000000000004 < y < -2.8999999999999999e-60 or 1.20000000000000001e-200 < y < 7.2000000000000001e-108 or 2.2000000000000001e-74 < y Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in z around 0 69.6%
div-sub69.6%
*-inverses69.6%
Simplified69.6%
if -2.8999999999999999e-60 < y < 1.20000000000000001e-200 or 7.2000000000000001e-108 < y < 2.2000000000000001e-74Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 81.6%
Final simplification75.7%
(FPCore (x y z)
:precision binary64
(if (<= y -0.00112)
(/ y (- y z))
(if (or (<= y -2.25e-58)
(and (not (<= y 9e-144))
(or (<= y 7.2e-108) (not (<= y 1.15e+27)))))
(- 1.0 (/ x y))
(/ (- x y) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -0.00112) {
tmp = y / (y - z);
} else if ((y <= -2.25e-58) || (!(y <= 9e-144) && ((y <= 7.2e-108) || !(y <= 1.15e+27)))) {
tmp = 1.0 - (x / y);
} else {
tmp = (x - 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 <= (-0.00112d0)) then
tmp = y / (y - z)
else if ((y <= (-2.25d-58)) .or. (.not. (y <= 9d-144)) .and. (y <= 7.2d-108) .or. (.not. (y <= 1.15d+27))) then
tmp = 1.0d0 - (x / y)
else
tmp = (x - y) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -0.00112) {
tmp = y / (y - z);
} else if ((y <= -2.25e-58) || (!(y <= 9e-144) && ((y <= 7.2e-108) || !(y <= 1.15e+27)))) {
tmp = 1.0 - (x / y);
} else {
tmp = (x - y) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -0.00112: tmp = y / (y - z) elif (y <= -2.25e-58) or (not (y <= 9e-144) and ((y <= 7.2e-108) or not (y <= 1.15e+27))): tmp = 1.0 - (x / y) else: tmp = (x - y) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -0.00112) tmp = Float64(y / Float64(y - z)); elseif ((y <= -2.25e-58) || (!(y <= 9e-144) && ((y <= 7.2e-108) || !(y <= 1.15e+27)))) tmp = Float64(1.0 - Float64(x / y)); else tmp = Float64(Float64(x - y) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -0.00112) tmp = y / (y - z); elseif ((y <= -2.25e-58) || (~((y <= 9e-144)) && ((y <= 7.2e-108) || ~((y <= 1.15e+27))))) tmp = 1.0 - (x / y); else tmp = (x - y) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -0.00112], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -2.25e-58], And[N[Not[LessEqual[y, 9e-144]], $MachinePrecision], Or[LessEqual[y, 7.2e-108], N[Not[LessEqual[y, 1.15e+27]], $MachinePrecision]]]], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00112:\\
\;\;\;\;\frac{y}{y - z}\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{-58} \lor \neg \left(y \leq 9 \cdot 10^{-144}\right) \land \left(y \leq 7.2 \cdot 10^{-108} \lor \neg \left(y \leq 1.15 \cdot 10^{+27}\right)\right):\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{z}\\
\end{array}
\end{array}
if y < -0.0011199999999999999Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in x around 0 77.3%
if -0.0011199999999999999 < y < -2.2500000000000001e-58 or 8.9999999999999996e-144 < y < 7.2000000000000001e-108 or 1.15e27 < y Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in z around 0 78.9%
div-sub78.9%
*-inverses78.9%
Simplified78.9%
if -2.2500000000000001e-58 < y < 8.9999999999999996e-144 or 7.2000000000000001e-108 < y < 1.15e27Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in z around inf 81.1%
associate-*r/81.1%
neg-mul-181.1%
neg-sub081.1%
associate--r-81.1%
neg-sub081.1%
Simplified81.1%
Taylor expanded in y around 0 81.1%
+-commutative81.1%
mul-1-neg81.1%
sub-neg81.1%
div-sub81.1%
Simplified81.1%
Final simplification79.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (- x y) z)) (t_1 (- 1.0 (/ x y))))
(if (<= y -0.74)
(/ y (- y z))
(if (<= y -4.6e-60)
t_1
(if (<= y 9e-144)
t_0
(if (<= y 7.6e-108) t_1 (if (<= y 1e+27) t_0 (/ (- y x) y))))))))
double code(double x, double y, double z) {
double t_0 = (x - y) / z;
double t_1 = 1.0 - (x / y);
double tmp;
if (y <= -0.74) {
tmp = y / (y - z);
} else if (y <= -4.6e-60) {
tmp = t_1;
} else if (y <= 9e-144) {
tmp = t_0;
} else if (y <= 7.6e-108) {
tmp = t_1;
} else if (y <= 1e+27) {
tmp = t_0;
} else {
tmp = (y - 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x - y) / z
t_1 = 1.0d0 - (x / y)
if (y <= (-0.74d0)) then
tmp = y / (y - z)
else if (y <= (-4.6d-60)) then
tmp = t_1
else if (y <= 9d-144) then
tmp = t_0
else if (y <= 7.6d-108) then
tmp = t_1
else if (y <= 1d+27) then
tmp = t_0
else
tmp = (y - x) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x - y) / z;
double t_1 = 1.0 - (x / y);
double tmp;
if (y <= -0.74) {
tmp = y / (y - z);
} else if (y <= -4.6e-60) {
tmp = t_1;
} else if (y <= 9e-144) {
tmp = t_0;
} else if (y <= 7.6e-108) {
tmp = t_1;
} else if (y <= 1e+27) {
tmp = t_0;
} else {
tmp = (y - x) / y;
}
return tmp;
}
def code(x, y, z): t_0 = (x - y) / z t_1 = 1.0 - (x / y) tmp = 0 if y <= -0.74: tmp = y / (y - z) elif y <= -4.6e-60: tmp = t_1 elif y <= 9e-144: tmp = t_0 elif y <= 7.6e-108: tmp = t_1 elif y <= 1e+27: tmp = t_0 else: tmp = (y - x) / y return tmp
function code(x, y, z) t_0 = Float64(Float64(x - y) / z) t_1 = Float64(1.0 - Float64(x / y)) tmp = 0.0 if (y <= -0.74) tmp = Float64(y / Float64(y - z)); elseif (y <= -4.6e-60) tmp = t_1; elseif (y <= 9e-144) tmp = t_0; elseif (y <= 7.6e-108) tmp = t_1; elseif (y <= 1e+27) tmp = t_0; else tmp = Float64(Float64(y - x) / y); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x - y) / z; t_1 = 1.0 - (x / y); tmp = 0.0; if (y <= -0.74) tmp = y / (y - z); elseif (y <= -4.6e-60) tmp = t_1; elseif (y <= 9e-144) tmp = t_0; elseif (y <= 7.6e-108) tmp = t_1; elseif (y <= 1e+27) tmp = t_0; else tmp = (y - x) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.74], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.6e-60], t$95$1, If[LessEqual[y, 9e-144], t$95$0, If[LessEqual[y, 7.6e-108], t$95$1, If[LessEqual[y, 1e+27], t$95$0, N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x - y}{z}\\
t_1 := 1 - \frac{x}{y}\\
\mathbf{if}\;y \leq -0.74:\\
\;\;\;\;\frac{y}{y - z}\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-144}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 10^{+27}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{y}\\
\end{array}
\end{array}
if y < -0.73999999999999999Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in x around 0 77.3%
if -0.73999999999999999 < y < -4.6000000000000003e-60 or 8.9999999999999996e-144 < y < 7.59999999999999947e-108Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 80.3%
div-sub80.4%
*-inverses80.4%
Simplified80.4%
if -4.6000000000000003e-60 < y < 8.9999999999999996e-144 or 7.59999999999999947e-108 < y < 1e27Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in z around inf 81.1%
associate-*r/81.1%
neg-mul-181.1%
neg-sub081.1%
associate--r-81.1%
neg-sub081.1%
Simplified81.1%
Taylor expanded in y around 0 81.1%
+-commutative81.1%
mul-1-neg81.1%
sub-neg81.1%
div-sub81.1%
Simplified81.1%
if 1e27 < y Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in z around 0 78.1%
Final simplification79.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (- x) (- y z))))
(if (<= x -5.6e-6)
t_0
(if (<= x -4.2e-96)
(/ (- x y) z)
(if (or (<= x -1.76e-124) (not (<= x 7e-82))) t_0 (/ y (- y z)))))))
double code(double x, double y, double z) {
double t_0 = -x / (y - z);
double tmp;
if (x <= -5.6e-6) {
tmp = t_0;
} else if (x <= -4.2e-96) {
tmp = (x - y) / z;
} else if ((x <= -1.76e-124) || !(x <= 7e-82)) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = -x / (y - z)
if (x <= (-5.6d-6)) then
tmp = t_0
else if (x <= (-4.2d-96)) then
tmp = (x - y) / z
else if ((x <= (-1.76d-124)) .or. (.not. (x <= 7d-82))) then
tmp = t_0
else
tmp = y / (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -x / (y - z);
double tmp;
if (x <= -5.6e-6) {
tmp = t_0;
} else if (x <= -4.2e-96) {
tmp = (x - y) / z;
} else if ((x <= -1.76e-124) || !(x <= 7e-82)) {
tmp = t_0;
} else {
tmp = y / (y - z);
}
return tmp;
}
def code(x, y, z): t_0 = -x / (y - z) tmp = 0 if x <= -5.6e-6: tmp = t_0 elif x <= -4.2e-96: tmp = (x - y) / z elif (x <= -1.76e-124) or not (x <= 7e-82): tmp = t_0 else: tmp = y / (y - z) return tmp
function code(x, y, z) t_0 = Float64(Float64(-x) / Float64(y - z)) tmp = 0.0 if (x <= -5.6e-6) tmp = t_0; elseif (x <= -4.2e-96) tmp = Float64(Float64(x - y) / z); elseif ((x <= -1.76e-124) || !(x <= 7e-82)) tmp = t_0; else tmp = Float64(y / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -x / (y - z); tmp = 0.0; if (x <= -5.6e-6) tmp = t_0; elseif (x <= -4.2e-96) tmp = (x - y) / z; elseif ((x <= -1.76e-124) || ~((x <= 7e-82))) tmp = t_0; else tmp = y / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[((-x) / N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.6e-6], t$95$0, If[LessEqual[x, -4.2e-96], N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[x, -1.76e-124], N[Not[LessEqual[x, 7e-82]], $MachinePrecision]], t$95$0, N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{y - z}\\
\mathbf{if}\;x \leq -5.6 \cdot 10^{-6}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-96}:\\
\;\;\;\;\frac{x - y}{z}\\
\mathbf{elif}\;x \leq -1.76 \cdot 10^{-124} \lor \neg \left(x \leq 7 \cdot 10^{-82}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y - z}\\
\end{array}
\end{array}
if x < -5.59999999999999975e-6 or -4.20000000000000002e-96 < x < -1.75999999999999996e-124 or 6.9999999999999997e-82 < x Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in x around inf 79.7%
neg-mul-179.7%
distribute-neg-frac79.7%
Simplified79.7%
if -5.59999999999999975e-6 < x < -4.20000000000000002e-96Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in z around inf 90.8%
associate-*r/90.8%
neg-mul-190.8%
neg-sub090.8%
associate--r-90.8%
neg-sub090.8%
Simplified90.8%
Taylor expanded in y around 0 90.8%
+-commutative90.8%
mul-1-neg90.8%
sub-neg90.8%
div-sub90.8%
Simplified90.8%
if -1.75999999999999996e-124 < x < 6.9999999999999997e-82Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in x around 0 89.3%
Final simplification83.3%
(FPCore (x y z) :precision binary64 (if (<= y -2.5e-54) 1.0 (if (<= y 1.1e+16) (/ x z) 1.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.5e-54) {
tmp = 1.0;
} else if (y <= 1.1e+16) {
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 <= (-2.5d-54)) then
tmp = 1.0d0
else if (y <= 1.1d+16) 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 <= -2.5e-54) {
tmp = 1.0;
} else if (y <= 1.1e+16) {
tmp = x / z;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.5e-54: tmp = 1.0 elif y <= 1.1e+16: tmp = x / z else: tmp = 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.5e-54) tmp = 1.0; elseif (y <= 1.1e+16) tmp = Float64(x / z); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.5e-54) tmp = 1.0; elseif (y <= 1.1e+16) tmp = x / z; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.5e-54], 1.0, If[LessEqual[y, 1.1e+16], N[(x / z), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-54}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+16}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.50000000000000008e-54 or 1.1e16 < y Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around inf 46.7%
if -2.50000000000000008e-54 < y < 1.1e16Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 68.3%
Final simplification58.2%
(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-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around inf 26.4%
Final simplification26.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 2023240
(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)))