
(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 10 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 96.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.6e+126)
t
(if (<= y 1.8e-30)
(* x (/ t (- z y)))
(if (<= y 3.6e+131) (* y (/ t (- y z))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.6e+126) {
tmp = t;
} else if (y <= 1.8e-30) {
tmp = x * (t / (z - y));
} else if (y <= 3.6e+131) {
tmp = y * (t / (y - 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 <= (-6.6d+126)) then
tmp = t
else if (y <= 1.8d-30) then
tmp = x * (t / (z - y))
else if (y <= 3.6d+131) then
tmp = y * (t / (y - 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 <= -6.6e+126) {
tmp = t;
} else if (y <= 1.8e-30) {
tmp = x * (t / (z - y));
} else if (y <= 3.6e+131) {
tmp = y * (t / (y - z));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.6e+126: tmp = t elif y <= 1.8e-30: tmp = x * (t / (z - y)) elif y <= 3.6e+131: tmp = y * (t / (y - z)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.6e+126) tmp = t; elseif (y <= 1.8e-30) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 3.6e+131) tmp = Float64(y * Float64(t / Float64(y - z))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.6e+126) tmp = t; elseif (y <= 1.8e-30) tmp = x * (t / (z - y)); elseif (y <= 3.6e+131) tmp = y * (t / (y - z)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.6e+126], t, If[LessEqual[y, 1.8e-30], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+131], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+126}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+131}:\\
\;\;\;\;y \cdot \frac{t}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -6.60000000000000026e126 or 3.60000000000000031e131 < y Initial program 100.0%
associate-*l/59.7%
associate-/l*71.8%
Simplified71.8%
Taylor expanded in y around inf 86.0%
if -6.60000000000000026e126 < y < 1.8000000000000002e-30Initial program 94.2%
associate-*l/94.7%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in x around inf 75.8%
if 1.8000000000000002e-30 < y < 3.60000000000000031e131Initial program 99.8%
associate-*l/77.7%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in x around 0 54.6%
associate-*r/54.6%
mul-1-neg54.6%
distribute-rgt-neg-out54.6%
associate-*l/61.4%
*-commutative61.4%
distribute-lft-neg-out61.4%
distribute-rgt-neg-in61.4%
distribute-frac-neg261.4%
neg-sub061.4%
sub-neg61.4%
+-commutative61.4%
associate--r+61.4%
neg-sub061.4%
remove-double-neg61.4%
Simplified61.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.12e+143) (not (<= y 9.5e+168))) (/ t (/ y (- y x))) (* (- x y) (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.12e+143) || !(y <= 9.5e+168)) {
tmp = t / (y / (y - x));
} 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 <= (-1.12d+143)) .or. (.not. (y <= 9.5d+168))) then
tmp = t / (y / (y - x))
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 <= -1.12e+143) || !(y <= 9.5e+168)) {
tmp = t / (y / (y - x));
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.12e+143) or not (y <= 9.5e+168): tmp = t / (y / (y - x)) else: tmp = (x - y) * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.12e+143) || !(y <= 9.5e+168)) tmp = Float64(t / Float64(y / Float64(y - x))); 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 <= -1.12e+143) || ~((y <= 9.5e+168))) tmp = t / (y / (y - x)); else tmp = (x - y) * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.12e+143], N[Not[LessEqual[y, 9.5e+168]], $MachinePrecision]], N[(t / N[(y / N[(y - x), $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 -1.12 \cdot 10^{+143} \lor \neg \left(y \leq 9.5 \cdot 10^{+168}\right):\\
\;\;\;\;\frac{t}{\frac{y}{y - x}}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -1.12e143 or 9.49999999999999979e168 < y Initial program 100.0%
associate-*l/54.8%
associate-/l*71.2%
Simplified71.2%
associate-*r/54.8%
associate-*l/100.0%
*-commutative100.0%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 95.2%
mul-1-neg95.2%
sub-neg95.2%
+-commutative95.2%
neg-sub095.2%
associate--r-95.2%
neg-sub095.2%
distribute-neg-frac295.2%
remove-double-neg95.2%
Simplified95.2%
if -1.12e143 < y < 9.49999999999999979e168Initial program 95.6%
associate-*l/91.6%
associate-/l*93.1%
Simplified93.1%
Final simplification93.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5e+45) (not (<= y 2.25e-30))) (* t (/ (- y x) y)) (/ (* x t) (- z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5e+45) || !(y <= 2.25e-30)) {
tmp = t * ((y - x) / y);
} 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 <= (-5d+45)) .or. (.not. (y <= 2.25d-30))) then
tmp = t * ((y - x) / y)
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 <= -5e+45) || !(y <= 2.25e-30)) {
tmp = t * ((y - x) / y);
} else {
tmp = (x * t) / (z - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5e+45) or not (y <= 2.25e-30): tmp = t * ((y - x) / y) else: tmp = (x * t) / (z - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5e+45) || !(y <= 2.25e-30)) tmp = Float64(t * Float64(Float64(y - x) / y)); else tmp = Float64(Float64(x * t) / Float64(z - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5e+45) || ~((y <= 2.25e-30))) tmp = t * ((y - x) / y); else tmp = (x * t) / (z - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5e+45], N[Not[LessEqual[y, 2.25e-30]], $MachinePrecision]], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+45} \lor \neg \left(y \leq 2.25 \cdot 10^{-30}\right):\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot t}{z - y}\\
\end{array}
\end{array}
if y < -5e45 or 2.24999999999999984e-30 < y Initial program 99.9%
Taylor expanded in z around 0 76.6%
associate-*r/76.6%
neg-mul-176.6%
neg-sub076.6%
sub-neg76.6%
+-commutative76.6%
associate--r+76.6%
neg-sub076.6%
remove-double-neg76.6%
Simplified76.6%
if -5e45 < y < 2.24999999999999984e-30Initial program 93.3%
associate-*l/96.1%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in x around inf 81.3%
Final simplification78.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.9e+45) (not (<= y 1e+33))) (* t (/ (- y x) y)) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.9e+45) || !(y <= 1e+33)) {
tmp = t * ((y - x) / y);
} 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.9d+45)) .or. (.not. (y <= 1d+33))) then
tmp = t * ((y - x) / y)
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.9e+45) || !(y <= 1e+33)) {
tmp = t * ((y - x) / y);
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.9e+45) or not (y <= 1e+33): tmp = t * ((y - x) / y) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.9e+45) || !(y <= 1e+33)) tmp = Float64(t * Float64(Float64(y - x) / y)); 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.9e+45) || ~((y <= 1e+33))) tmp = t * ((y - x) / y); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.9e+45], N[Not[LessEqual[y, 1e+33]], $MachinePrecision]], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+45} \lor \neg \left(y \leq 10^{+33}\right):\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -4.9000000000000002e45 or 9.9999999999999995e32 < y Initial program 99.9%
Taylor expanded in z around 0 79.5%
associate-*r/79.5%
neg-mul-179.5%
neg-sub079.5%
sub-neg79.5%
+-commutative79.5%
associate--r+79.5%
neg-sub079.5%
remove-double-neg79.5%
Simplified79.5%
if -4.9000000000000002e45 < y < 9.9999999999999995e32Initial program 93.8%
associate-*l/94.3%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in x around inf 77.4%
Final simplification78.4%
(FPCore (x y z t) :precision binary64 (if (<= y -6.6e+126) t (if (<= y 3.5e+40) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.6e+126) {
tmp = t;
} else if (y <= 3.5e+40) {
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 <= (-6.6d+126)) then
tmp = t
else if (y <= 3.5d+40) 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 <= -6.6e+126) {
tmp = t;
} else if (y <= 3.5e+40) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.6e+126: tmp = t elif y <= 3.5e+40: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.6e+126) tmp = t; elseif (y <= 3.5e+40) 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 <= -6.6e+126) tmp = t; elseif (y <= 3.5e+40) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.6e+126], t, If[LessEqual[y, 3.5e+40], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+126}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+40}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -6.60000000000000026e126 or 3.4999999999999999e40 < y Initial program 99.9%
associate-*l/65.5%
associate-/l*75.0%
Simplified75.0%
Taylor expanded in y around inf 74.2%
if -6.60000000000000026e126 < y < 3.4999999999999999e40Initial program 94.7%
associate-*l/92.8%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in x around inf 74.0%
(FPCore (x y z t) :precision binary64 (if (<= y -4.3e+71) t (if (<= y 2.55e+38) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.3e+71) {
tmp = t;
} else if (y <= 2.55e+38) {
tmp = t / (z / x);
} 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 <= (-4.3d+71)) then
tmp = t
else if (y <= 2.55d+38) then
tmp = t / (z / x)
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 <= -4.3e+71) {
tmp = t;
} else if (y <= 2.55e+38) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.3e+71: tmp = t elif y <= 2.55e+38: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.3e+71) tmp = t; elseif (y <= 2.55e+38) tmp = Float64(t / Float64(z / x)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.3e+71) tmp = t; elseif (y <= 2.55e+38) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.3e+71], t, If[LessEqual[y, 2.55e+38], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{+71}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{+38}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.29999999999999984e71 or 2.5500000000000001e38 < y Initial program 99.9%
associate-*l/68.7%
associate-/l*77.9%
Simplified77.9%
Taylor expanded in y around inf 69.9%
if -4.29999999999999984e71 < y < 2.5500000000000001e38Initial program 94.2%
associate-*l/92.8%
associate-/l*95.0%
Simplified95.0%
associate-*r/92.8%
associate-*l/94.2%
*-commutative94.2%
clear-num93.9%
un-div-inv93.9%
Applied egg-rr93.9%
Taylor expanded in y around 0 64.9%
(FPCore (x y z t) :precision binary64 (if (<= y -2.4e+71) t (if (<= y 8.8e+34) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e+71) {
tmp = t;
} else if (y <= 8.8e+34) {
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.4d+71)) then
tmp = t
else if (y <= 8.8d+34) 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.4e+71) {
tmp = t;
} else if (y <= 8.8e+34) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.4e+71: tmp = t elif y <= 8.8e+34: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.4e+71) tmp = t; elseif (y <= 8.8e+34) 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.4e+71) tmp = t; elseif (y <= 8.8e+34) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.4e+71], t, If[LessEqual[y, 8.8e+34], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+71}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{+34}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.39999999999999981e71 or 8.8000000000000009e34 < y Initial program 99.9%
associate-*l/68.7%
associate-/l*77.9%
Simplified77.9%
Taylor expanded in y around inf 69.9%
if -2.39999999999999981e71 < y < 8.8000000000000009e34Initial program 94.2%
Taylor expanded in y around 0 64.9%
Final simplification67.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.04e+70) t (if (<= y 2.35e+38) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.04e+70) {
tmp = t;
} else if (y <= 2.35e+38) {
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.04d+70)) then
tmp = t
else if (y <= 2.35d+38) 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.04e+70) {
tmp = t;
} else if (y <= 2.35e+38) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.04e+70: tmp = t elif y <= 2.35e+38: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.04e+70) tmp = t; elseif (y <= 2.35e+38) 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.04e+70) tmp = t; elseif (y <= 2.35e+38) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.04e+70], t, If[LessEqual[y, 2.35e+38], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.04 \cdot 10^{+70}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{+38}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.0400000000000001e70 or 2.35e38 < y Initial program 99.9%
associate-*l/68.7%
associate-/l*77.9%
Simplified77.9%
Taylor expanded in y around inf 69.9%
if -1.0400000000000001e70 < y < 2.35e38Initial program 94.2%
associate-*l/92.8%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in x around inf 76.2%
Taylor expanded in z around inf 63.5%
(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 96.7%
associate-*l/82.2%
associate-/l*87.5%
Simplified87.5%
Taylor expanded in y around inf 38.7%
(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 2024145
(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))