
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Initial program 97.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e+52)
t
(if (<= y 3.7e-103)
(* x (/ t (- z y)))
(if (<= y 5.8e+56) (* (- x y) (/ t z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+52) {
tmp = t;
} else if (y <= 3.7e-103) {
tmp = x * (t / (z - y));
} else if (y <= 5.8e+56) {
tmp = (x - y) * (t / z);
} else {
tmp = t;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-1.7d+52)) then
tmp = t
else if (y <= 3.7d-103) then
tmp = x * (t / (z - y))
else if (y <= 5.8d+56) then
tmp = (x - y) * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+52) {
tmp = t;
} else if (y <= 3.7e-103) {
tmp = x * (t / (z - y));
} else if (y <= 5.8e+56) {
tmp = (x - y) * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+52: tmp = t elif y <= 3.7e-103: tmp = x * (t / (z - y)) elif y <= 5.8e+56: tmp = (x - y) * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+52) tmp = t; elseif (y <= 3.7e-103) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 5.8e+56) tmp = Float64(Float64(x - y) * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e+52) tmp = t; elseif (y <= 3.7e-103) tmp = x * (t / (z - y)); elseif (y <= 5.8e+56) tmp = (x - y) * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+52], t, If[LessEqual[y, 3.7e-103], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e+56], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+52}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-103}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+56}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.7e52 or 5.80000000000000014e56 < y Initial program 99.8%
associate-*l/72.9%
associate-/l*76.7%
Simplified76.7%
Taylor expanded in y around inf 68.3%
if -1.7e52 < y < 3.6999999999999999e-103Initial program 95.2%
associate-*l/93.4%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in x around inf 75.0%
if 3.6999999999999999e-103 < y < 5.80000000000000014e56Initial program 99.7%
associate-*l/96.7%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in z around inf 74.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4e+146) (not (<= y 8.2e+157))) (* t (/ y (- y z))) (* (- x y) (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4e+146) || !(y <= 8.2e+157)) {
tmp = t * (y / (y - z));
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
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
real(8) :: tmp
if ((y <= (-4d+146)) .or. (.not. (y <= 8.2d+157))) then
tmp = t * (y / (y - z))
else
tmp = (x - y) * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4e+146) || !(y <= 8.2e+157)) {
tmp = t * (y / (y - z));
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4e+146) or not (y <= 8.2e+157): tmp = t * (y / (y - z)) else: tmp = (x - y) * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4e+146) || !(y <= 8.2e+157)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4e+146) || ~((y <= 8.2e+157))) tmp = t * (y / (y - z)); else tmp = (x - y) * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4e+146], N[Not[LessEqual[y, 8.2e+157]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+146} \lor \neg \left(y \leq 8.2 \cdot 10^{+157}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -3.99999999999999973e146 or 8.20000000000000032e157 < y Initial program 99.9%
Taylor expanded in x around 0 90.9%
neg-mul-190.9%
distribute-neg-frac290.9%
neg-sub090.9%
sub-neg90.9%
+-commutative90.9%
associate--r+90.9%
neg-sub090.9%
remove-double-neg90.9%
Simplified90.9%
if -3.99999999999999973e146 < y < 8.20000000000000032e157Initial program 97.1%
associate-*l/93.1%
associate-/l*90.9%
Simplified90.9%
Final simplification90.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.9e+19) (not (<= y 1.65e-5))) (* t (- 1.0 (/ x y))) (* t (/ (- x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.9e+19) || !(y <= 1.65e-5)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t * ((x - y) / z);
}
return tmp;
}
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
real(8) :: tmp
if ((y <= (-4.9d+19)) .or. (.not. (y <= 1.65d-5))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = t * ((x - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.9e+19) || !(y <= 1.65e-5)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t * ((x - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.9e+19) or not (y <= 1.65e-5): tmp = t * (1.0 - (x / y)) else: tmp = t * ((x - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.9e+19) || !(y <= 1.65e-5)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(t * Float64(Float64(x - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.9e+19) || ~((y <= 1.65e-5))) tmp = t * (1.0 - (x / y)); else tmp = t * ((x - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.9e+19], N[Not[LessEqual[y, 1.65e-5]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+19} \lor \neg \left(y \leq 1.65 \cdot 10^{-5}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\end{array}
\end{array}
if y < -4.9e19 or 1.6500000000000001e-5 < y Initial program 99.8%
associate-*l/77.5%
associate-/l*80.6%
Simplified80.6%
associate-*r/77.5%
associate-*l/99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 61.3%
mul-1-neg61.3%
associate-/l*80.5%
distribute-rgt-neg-in80.5%
div-sub80.6%
*-inverses80.6%
Simplified80.6%
if -4.9e19 < y < 1.6500000000000001e-5Initial program 95.5%
Taylor expanded in z around inf 79.1%
Final simplification79.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9e+18) (not (<= y 2.7e-6))) (* t (/ (- y x) y)) (* t (/ (- x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e+18) || !(y <= 2.7e-6)) {
tmp = t * ((y - x) / y);
} else {
tmp = t * ((x - y) / z);
}
return tmp;
}
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
real(8) :: tmp
if ((y <= (-9d+18)) .or. (.not. (y <= 2.7d-6))) then
tmp = t * ((y - x) / y)
else
tmp = t * ((x - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e+18) || !(y <= 2.7e-6)) {
tmp = t * ((y - x) / y);
} else {
tmp = t * ((x - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9e+18) or not (y <= 2.7e-6): tmp = t * ((y - x) / y) else: tmp = t * ((x - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9e+18) || !(y <= 2.7e-6)) tmp = Float64(t * Float64(Float64(y - x) / y)); else tmp = Float64(t * Float64(Float64(x - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9e+18) || ~((y <= 2.7e-6))) tmp = t * ((y - x) / y); else tmp = t * ((x - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9e+18], N[Not[LessEqual[y, 2.7e-6]], $MachinePrecision]], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+18} \lor \neg \left(y \leq 2.7 \cdot 10^{-6}\right):\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\end{array}
\end{array}
if y < -9e18 or 2.69999999999999998e-6 < y Initial program 99.8%
Taylor expanded in z around 0 80.5%
associate-*r/80.5%
neg-mul-180.5%
neg-sub080.5%
sub-neg80.5%
+-commutative80.5%
associate--r+80.5%
neg-sub080.5%
remove-double-neg80.5%
Simplified80.5%
if -9e18 < y < 2.69999999999999998e-6Initial program 95.5%
Taylor expanded in z around inf 79.1%
Final simplification79.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.4e+19) (not (<= y 2.3e-13))) (* t (/ y (- y z))) (* t (/ (- x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.4e+19) || !(y <= 2.3e-13)) {
tmp = t * (y / (y - z));
} else {
tmp = t * ((x - y) / z);
}
return tmp;
}
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
real(8) :: tmp
if ((y <= (-4.4d+19)) .or. (.not. (y <= 2.3d-13))) then
tmp = t * (y / (y - z))
else
tmp = t * ((x - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.4e+19) || !(y <= 2.3e-13)) {
tmp = t * (y / (y - z));
} else {
tmp = t * ((x - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.4e+19) or not (y <= 2.3e-13): tmp = t * (y / (y - z)) else: tmp = t * ((x - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.4e+19) || !(y <= 2.3e-13)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(t * Float64(Float64(x - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.4e+19) || ~((y <= 2.3e-13))) tmp = t * (y / (y - z)); else tmp = t * ((x - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.4e+19], N[Not[LessEqual[y, 2.3e-13]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+19} \lor \neg \left(y \leq 2.3 \cdot 10^{-13}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\end{array}
\end{array}
if y < -4.4e19 or 2.29999999999999979e-13 < y Initial program 99.8%
Taylor expanded in x around 0 77.7%
neg-mul-177.7%
distribute-neg-frac277.7%
neg-sub077.7%
sub-neg77.7%
+-commutative77.7%
associate--r+77.7%
neg-sub077.7%
remove-double-neg77.7%
Simplified77.7%
if -4.4e19 < y < 2.29999999999999979e-13Initial program 95.4%
Taylor expanded in z around inf 78.6%
Final simplification78.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.2e+16) (not (<= y 4.3e-13))) (* t (/ y (- y z))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2e+16) || !(y <= 4.3e-13)) {
tmp = t * (y / (y - z));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
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
real(8) :: tmp
if ((y <= (-4.2d+16)) .or. (.not. (y <= 4.3d-13))) then
tmp = t * (y / (y - z))
else
tmp = x * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2e+16) || !(y <= 4.3e-13)) {
tmp = t * (y / (y - z));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.2e+16) or not (y <= 4.3e-13): tmp = t * (y / (y - z)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.2e+16) || !(y <= 4.3e-13)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.2e+16) || ~((y <= 4.3e-13))) tmp = t * (y / (y - z)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.2e+16], N[Not[LessEqual[y, 4.3e-13]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+16} \lor \neg \left(y \leq 4.3 \cdot 10^{-13}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -4.2e16 or 4.2999999999999999e-13 < y Initial program 99.8%
Taylor expanded in x around 0 77.9%
neg-mul-177.9%
distribute-neg-frac277.9%
neg-sub077.9%
sub-neg77.9%
+-commutative77.9%
associate--r+77.9%
neg-sub077.9%
remove-double-neg77.9%
Simplified77.9%
if -4.2e16 < y < 4.2999999999999999e-13Initial program 95.4%
associate-*l/92.8%
associate-/l*89.8%
Simplified89.8%
Taylor expanded in x around inf 77.5%
Final simplification77.7%
(FPCore (x y z t) :precision binary64 (if (<= y -3.7e+52) t (if (<= y 1.7e+24) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.7e+52) {
tmp = t;
} else if (y <= 1.7e+24) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-3.7d+52)) then
tmp = t
else if (y <= 1.7d+24) then
tmp = x * (t / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.7e+52) {
tmp = t;
} else if (y <= 1.7e+24) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.7e+52: tmp = t elif y <= 1.7e+24: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.7e+52) tmp = t; elseif (y <= 1.7e+24) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.7e+52) tmp = t; elseif (y <= 1.7e+24) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.7e+52], t, If[LessEqual[y, 1.7e+24], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+52}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.7e52 or 1.7e24 < y Initial program 99.8%
associate-*l/74.1%
associate-/l*77.7%
Simplified77.7%
Taylor expanded in y around inf 67.0%
if -3.7e52 < y < 1.7e24Initial program 96.0%
associate-*l/93.9%
associate-/l*91.2%
Simplified91.2%
Taylor expanded in x around inf 72.1%
(FPCore (x y z t) :precision binary64 (if (<= y -2.05e+19) t (if (<= y 1.55e-12) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.05e+19) {
tmp = t;
} else if (y <= 1.55e-12) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-2.05d+19)) then
tmp = t
else if (y <= 1.55d-12) then
tmp = t * (x / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.05e+19) {
tmp = t;
} else if (y <= 1.55e-12) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.05e+19: tmp = t elif y <= 1.55e-12: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.05e+19) tmp = t; elseif (y <= 1.55e-12) tmp = Float64(t * Float64(x / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.05e+19) tmp = t; elseif (y <= 1.55e-12) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.05e+19], t, If[LessEqual[y, 1.55e-12], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+19}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-12}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.05e19 or 1.5500000000000001e-12 < y Initial program 99.8%
associate-*l/78.0%
associate-/l*81.0%
Simplified81.0%
Taylor expanded in y around inf 62.5%
if -2.05e19 < y < 1.5500000000000001e-12Initial program 95.4%
Taylor expanded in y around 0 71.4%
Final simplification66.8%
(FPCore (x y z t) :precision binary64 (if (<= y -1.05e+20) t (if (<= y 9.6e-13) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e+20) {
tmp = t;
} else if (y <= 9.6e-13) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
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
real(8) :: tmp
if (y <= (-1.05d+20)) then
tmp = t
else if (y <= 9.6d-13) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e+20) {
tmp = t;
} else if (y <= 9.6e-13) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.05e+20: tmp = t elif y <= 9.6e-13: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.05e+20) tmp = t; elseif (y <= 9.6e-13) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.05e+20) tmp = t; elseif (y <= 9.6e-13) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.05e+20], t, If[LessEqual[y, 9.6e-13], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+20}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.05e20 or 9.5999999999999995e-13 < y Initial program 99.8%
associate-*l/78.0%
associate-/l*81.0%
Simplified81.0%
Taylor expanded in y around inf 62.5%
if -1.05e20 < y < 9.5999999999999995e-13Initial program 95.4%
associate-*l/92.9%
associate-/l*89.8%
Simplified89.8%
Taylor expanded in z around inf 73.2%
Taylor expanded in x around inf 66.8%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return t;
}
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 = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 97.7%
associate-*l/85.1%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in y around inf 37.9%
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
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 = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
herbie shell --seed 2024181
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (/ t (/ (- z y) (- x y))))
(* (/ (- x y) (- z y)) t))