
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6e+182) (not (<= t 1.4e+117))) (+ (- x (* a (/ y t))) (* y (/ z t))) (- (+ x y) (pow (/ (/ (- a t) y) (- z t)) -1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6e+182) || !(t <= 1.4e+117)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) - pow((((a - t) / y) / (z - t)), -1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-6d+182)) .or. (.not. (t <= 1.4d+117))) then
tmp = (x - (a * (y / t))) + (y * (z / t))
else
tmp = (x + y) - ((((a - t) / y) / (z - t)) ** (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6e+182) || !(t <= 1.4e+117)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) - Math.pow((((a - t) / y) / (z - t)), -1.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6e+182) or not (t <= 1.4e+117): tmp = (x - (a * (y / t))) + (y * (z / t)) else: tmp = (x + y) - math.pow((((a - t) / y) / (z - t)), -1.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6e+182) || !(t <= 1.4e+117)) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / t))); else tmp = Float64(Float64(x + y) - (Float64(Float64(Float64(a - t) / y) / Float64(z - t)) ^ -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6e+182) || ~((t <= 1.4e+117))) tmp = (x - (a * (y / t))) + (y * (z / t)); else tmp = (x + y) - ((((a - t) / y) / (z - t)) ^ -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6e+182], N[Not[LessEqual[t, 1.4e+117]], $MachinePrecision]], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[Power[N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+182} \lor \neg \left(t \leq 1.4 \cdot 10^{+117}\right):\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - {\left(\frac{\frac{a - t}{y}}{z - t}\right)}^{-1}\\
\end{array}
\end{array}
if t < -6.0000000000000004e182 or 1.39999999999999999e117 < t Initial program 49.9%
clear-num50.1%
inv-pow50.1%
*-commutative50.1%
associate-/r*61.1%
Applied egg-rr61.1%
Taylor expanded in t around inf 82.8%
sub-neg82.8%
mul-1-neg82.8%
unsub-neg82.8%
associate-/l*86.3%
mul-1-neg86.3%
remove-double-neg86.3%
associate-/l*96.8%
Simplified96.8%
if -6.0000000000000004e182 < t < 1.39999999999999999e117Initial program 86.5%
clear-num86.5%
inv-pow86.5%
*-commutative86.5%
associate-/r*90.7%
Applied egg-rr90.7%
Final simplification92.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.16e+182) (not (<= t 8e+115))) (+ (- x (* a (/ y t))) (* y (/ z t))) (fma (- z t) (/ y (- t a)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.16e+182) || !(t <= 8e+115)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = fma((z - t), (y / (t - a)), (x + y));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.16e+182) || !(t <= 8e+115)) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / t))); else tmp = fma(Float64(z - t), Float64(y / Float64(t - a)), Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.16e+182], N[Not[LessEqual[t, 8e+115]], $MachinePrecision]], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.16 \cdot 10^{+182} \lor \neg \left(t \leq 8 \cdot 10^{+115}\right):\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\end{array}
\end{array}
if t < -1.16e182 or 8.0000000000000001e115 < t Initial program 49.9%
clear-num50.1%
inv-pow50.1%
*-commutative50.1%
associate-/r*61.1%
Applied egg-rr61.1%
Taylor expanded in t around inf 82.8%
sub-neg82.8%
mul-1-neg82.8%
unsub-neg82.8%
associate-/l*86.3%
mul-1-neg86.3%
remove-double-neg86.3%
associate-/l*96.8%
Simplified96.8%
if -1.16e182 < t < 8.0000000000000001e115Initial program 86.5%
sub-neg86.5%
+-commutative86.5%
distribute-frac-neg86.5%
distribute-rgt-neg-out86.5%
associate-/l*90.2%
fma-define90.2%
distribute-frac-neg90.2%
distribute-neg-frac290.2%
sub-neg90.2%
distribute-neg-in90.2%
remove-double-neg90.2%
+-commutative90.2%
sub-neg90.2%
Simplified90.2%
Final simplification92.1%
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -7.9e+36)
(not (or (<= a -5.8e+28) (and (not (<= a -1.3e-6)) (<= a 7.4e-28)))))
(+ x y)
(- x (/ (* y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.9e+36) || !((a <= -5.8e+28) || (!(a <= -1.3e-6) && (a <= 7.4e-28)))) {
tmp = x + y;
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-7.9d+36)) .or. (.not. (a <= (-5.8d+28)) .or. (.not. (a <= (-1.3d-6))) .and. (a <= 7.4d-28))) then
tmp = x + y
else
tmp = x - ((y * (a - z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.9e+36) || !((a <= -5.8e+28) || (!(a <= -1.3e-6) && (a <= 7.4e-28)))) {
tmp = x + y;
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.9e+36) or not ((a <= -5.8e+28) or (not (a <= -1.3e-6) and (a <= 7.4e-28))): tmp = x + y else: tmp = x - ((y * (a - z)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.9e+36) || !((a <= -5.8e+28) || (!(a <= -1.3e-6) && (a <= 7.4e-28)))) tmp = Float64(x + y); else tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7.9e+36) || ~(((a <= -5.8e+28) || (~((a <= -1.3e-6)) && (a <= 7.4e-28))))) tmp = x + y; else tmp = x - ((y * (a - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.9e+36], N[Not[Or[LessEqual[a, -5.8e+28], And[N[Not[LessEqual[a, -1.3e-6]], $MachinePrecision], LessEqual[a, 7.4e-28]]]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.9 \cdot 10^{+36} \lor \neg \left(a \leq -5.8 \cdot 10^{+28} \lor \neg \left(a \leq -1.3 \cdot 10^{-6}\right) \land a \leq 7.4 \cdot 10^{-28}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\end{array}
\end{array}
if a < -7.90000000000000038e36 or -5.8000000000000002e28 < a < -1.30000000000000005e-6 or 7.40000000000000039e-28 < a Initial program 82.2%
Taylor expanded in a around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -7.90000000000000038e36 < a < -5.8000000000000002e28 or -1.30000000000000005e-6 < a < 7.40000000000000039e-28Initial program 69.9%
Taylor expanded in t around inf 77.3%
associate--l+77.3%
distribute-lft-out--77.3%
div-sub78.1%
mul-1-neg78.1%
unsub-neg78.1%
*-commutative78.1%
distribute-lft-out--78.1%
Simplified78.1%
Final simplification78.2%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -4.5e+221)
(and (not (<= z -7.4e+143))
(or (<= z -1.7e+84) (not (<= z 6.2e+217)))))
(* y (/ z (- t a)))
(+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+221) || (!(z <= -7.4e+143) && ((z <= -1.7e+84) || !(z <= 6.2e+217)))) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.5d+221)) .or. (.not. (z <= (-7.4d+143))) .and. (z <= (-1.7d+84)) .or. (.not. (z <= 6.2d+217))) then
tmp = y * (z / (t - a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+221) || (!(z <= -7.4e+143) && ((z <= -1.7e+84) || !(z <= 6.2e+217)))) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e+221) or (not (z <= -7.4e+143) and ((z <= -1.7e+84) or not (z <= 6.2e+217))): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e+221) || (!(z <= -7.4e+143) && ((z <= -1.7e+84) || !(z <= 6.2e+217)))) tmp = Float64(y * Float64(z / Float64(t - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.5e+221) || (~((z <= -7.4e+143)) && ((z <= -1.7e+84) || ~((z <= 6.2e+217))))) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e+221], And[N[Not[LessEqual[z, -7.4e+143]], $MachinePrecision], Or[LessEqual[z, -1.7e+84], N[Not[LessEqual[z, 6.2e+217]], $MachinePrecision]]]], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+221} \lor \neg \left(z \leq -7.4 \cdot 10^{+143}\right) \land \left(z \leq -1.7 \cdot 10^{+84} \lor \neg \left(z \leq 6.2 \cdot 10^{+217}\right)\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.5000000000000002e221 or -7.4000000000000003e143 < z < -1.6999999999999999e84 or 6.2000000000000003e217 < z Initial program 75.8%
sub-neg75.8%
+-commutative75.8%
distribute-frac-neg75.8%
distribute-rgt-neg-out75.8%
associate-/l*88.7%
fma-define88.7%
distribute-frac-neg88.7%
distribute-neg-frac288.7%
sub-neg88.7%
distribute-neg-in88.7%
remove-double-neg88.7%
+-commutative88.7%
sub-neg88.7%
Simplified88.7%
Taylor expanded in z around inf 60.5%
associate-/l*70.8%
Simplified70.8%
if -4.5000000000000002e221 < z < -7.4000000000000003e143 or -1.6999999999999999e84 < z < 6.2000000000000003e217Initial program 76.2%
Taylor expanded in a around inf 69.7%
+-commutative69.7%
Simplified69.7%
Final simplification70.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y (- t a)))))
(if (<= z -4.6e+221)
t_1
(if (<= z -1.95e+144)
(+ x y)
(if (<= z -4e+83)
(* y (/ z (- t a)))
(if (<= z 8.2e+217) (+ x y) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (t - a));
double tmp;
if (z <= -4.6e+221) {
tmp = t_1;
} else if (z <= -1.95e+144) {
tmp = x + y;
} else if (z <= -4e+83) {
tmp = y * (z / (t - a));
} else if (z <= 8.2e+217) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = z * (y / (t - a))
if (z <= (-4.6d+221)) then
tmp = t_1
else if (z <= (-1.95d+144)) then
tmp = x + y
else if (z <= (-4d+83)) then
tmp = y * (z / (t - a))
else if (z <= 8.2d+217) then
tmp = x + y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (t - a));
double tmp;
if (z <= -4.6e+221) {
tmp = t_1;
} else if (z <= -1.95e+144) {
tmp = x + y;
} else if (z <= -4e+83) {
tmp = y * (z / (t - a));
} else if (z <= 8.2e+217) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / (t - a)) tmp = 0 if z <= -4.6e+221: tmp = t_1 elif z <= -1.95e+144: tmp = x + y elif z <= -4e+83: tmp = y * (z / (t - a)) elif z <= 8.2e+217: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(t - a))) tmp = 0.0 if (z <= -4.6e+221) tmp = t_1; elseif (z <= -1.95e+144) tmp = Float64(x + y); elseif (z <= -4e+83) tmp = Float64(y * Float64(z / Float64(t - a))); elseif (z <= 8.2e+217) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / (t - a)); tmp = 0.0; if (z <= -4.6e+221) tmp = t_1; elseif (z <= -1.95e+144) tmp = x + y; elseif (z <= -4e+83) tmp = y * (z / (t - a)); elseif (z <= 8.2e+217) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+221], t$95$1, If[LessEqual[z, -1.95e+144], N[(x + y), $MachinePrecision], If[LessEqual[z, -4e+83], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+217], N[(x + y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{t - a}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+221}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{+144}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+83}:\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+217}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.59999999999999973e221 or 8.2000000000000005e217 < z Initial program 82.9%
sub-neg82.9%
+-commutative82.9%
distribute-frac-neg82.9%
distribute-rgt-neg-out82.9%
associate-/l*94.4%
fma-define94.4%
distribute-frac-neg94.4%
distribute-neg-frac294.4%
sub-neg94.4%
distribute-neg-in94.4%
remove-double-neg94.4%
+-commutative94.4%
sub-neg94.4%
Simplified94.4%
Taylor expanded in z around inf 65.4%
associate-/l*73.6%
Simplified73.6%
clear-num73.4%
un-div-inv74.4%
Applied egg-rr74.4%
associate-/r/75.9%
Simplified75.9%
if -4.59999999999999973e221 < z < -1.95000000000000009e144 or -4.00000000000000012e83 < z < 8.2000000000000005e217Initial program 76.2%
Taylor expanded in a around inf 69.7%
+-commutative69.7%
Simplified69.7%
if -1.95000000000000009e144 < z < -4.00000000000000012e83Initial program 59.1%
sub-neg59.1%
+-commutative59.1%
distribute-frac-neg59.1%
distribute-rgt-neg-out59.1%
associate-/l*75.4%
fma-define75.6%
distribute-frac-neg75.6%
distribute-neg-frac275.6%
sub-neg75.6%
distribute-neg-in75.6%
remove-double-neg75.6%
+-commutative75.6%
sub-neg75.6%
Simplified75.6%
Taylor expanded in z around inf 49.4%
associate-/l*64.3%
Simplified64.3%
Final simplification70.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.8e+222)
(* (/ y t) z)
(if (<= z -1.55e+141)
(+ x y)
(if (<= z -1.35e+82)
(* y (/ z t))
(if (<= z 1.25e+220) (+ x y) (* y (/ z (- a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+222) {
tmp = (y / t) * z;
} else if (z <= -1.55e+141) {
tmp = x + y;
} else if (z <= -1.35e+82) {
tmp = y * (z / t);
} else if (z <= 1.25e+220) {
tmp = x + y;
} else {
tmp = y * (z / -a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.8d+222)) then
tmp = (y / t) * z
else if (z <= (-1.55d+141)) then
tmp = x + y
else if (z <= (-1.35d+82)) then
tmp = y * (z / t)
else if (z <= 1.25d+220) then
tmp = x + y
else
tmp = y * (z / -a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+222) {
tmp = (y / t) * z;
} else if (z <= -1.55e+141) {
tmp = x + y;
} else if (z <= -1.35e+82) {
tmp = y * (z / t);
} else if (z <= 1.25e+220) {
tmp = x + y;
} else {
tmp = y * (z / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.8e+222: tmp = (y / t) * z elif z <= -1.55e+141: tmp = x + y elif z <= -1.35e+82: tmp = y * (z / t) elif z <= 1.25e+220: tmp = x + y else: tmp = y * (z / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e+222) tmp = Float64(Float64(y / t) * z); elseif (z <= -1.55e+141) tmp = Float64(x + y); elseif (z <= -1.35e+82) tmp = Float64(y * Float64(z / t)); elseif (z <= 1.25e+220) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.8e+222) tmp = (y / t) * z; elseif (z <= -1.55e+141) tmp = x + y; elseif (z <= -1.35e+82) tmp = y * (z / t); elseif (z <= 1.25e+220) tmp = x + y; else tmp = y * (z / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+222], N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, -1.55e+141], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.35e+82], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+220], N[(x + y), $MachinePrecision], N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+222}:\\
\;\;\;\;\frac{y}{t} \cdot z\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{+141}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{+82}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+220}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{-a}\\
\end{array}
\end{array}
if z < -3.80000000000000018e222Initial program 80.3%
sub-neg80.3%
+-commutative80.3%
distribute-frac-neg80.3%
distribute-rgt-neg-out80.3%
associate-/l*93.9%
fma-define93.8%
distribute-frac-neg93.8%
distribute-neg-frac293.8%
sub-neg93.8%
distribute-neg-in93.8%
remove-double-neg93.8%
+-commutative93.8%
sub-neg93.8%
Simplified93.8%
Taylor expanded in z around inf 64.3%
associate-/l*75.8%
Simplified75.8%
clear-num75.6%
un-div-inv75.8%
Applied egg-rr75.8%
associate-/r/79.9%
Simplified79.9%
Taylor expanded in t around inf 71.9%
if -3.80000000000000018e222 < z < -1.55000000000000002e141 or -1.35e82 < z < 1.2500000000000001e220Initial program 76.3%
Taylor expanded in a around inf 69.4%
+-commutative69.4%
Simplified69.4%
if -1.55000000000000002e141 < z < -1.35e82Initial program 59.1%
sub-neg59.1%
+-commutative59.1%
distribute-frac-neg59.1%
distribute-rgt-neg-out59.1%
associate-/l*75.4%
fma-define75.6%
distribute-frac-neg75.6%
distribute-neg-frac275.6%
sub-neg75.6%
distribute-neg-in75.6%
remove-double-neg75.6%
+-commutative75.6%
sub-neg75.6%
Simplified75.6%
Taylor expanded in z around inf 49.4%
associate-/l*64.3%
Simplified64.3%
Taylor expanded in t around inf 39.6%
associate-/l*54.4%
Simplified54.4%
if 1.2500000000000001e220 < z Initial program 85.4%
sub-neg85.4%
+-commutative85.4%
distribute-frac-neg85.4%
distribute-rgt-neg-out85.4%
associate-/l*94.8%
fma-define94.8%
distribute-frac-neg94.8%
distribute-neg-frac294.8%
sub-neg94.8%
distribute-neg-in94.8%
remove-double-neg94.8%
+-commutative94.8%
sub-neg94.8%
Simplified94.8%
Taylor expanded in z around inf 64.9%
associate-/l*69.5%
Simplified69.5%
Taylor expanded in t around 0 59.3%
mul-1-neg59.3%
associate-*r/64.2%
distribute-lft-neg-in64.2%
Simplified64.2%
Final simplification68.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.16e+182) (not (<= t 510000.0))) (+ (- x (* a (/ y t))) (* y (/ z t))) (- (+ x y) (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.16e+182) || !(t <= 510000.0)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.16d+182)) .or. (.not. (t <= 510000.0d0))) then
tmp = (x - (a * (y / t))) + (y * (z / t))
else
tmp = (x + y) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.16e+182) || !(t <= 510000.0)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.16e+182) or not (t <= 510000.0): tmp = (x - (a * (y / t))) + (y * (z / t)) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.16e+182) || !(t <= 510000.0)) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / t))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.16e+182) || ~((t <= 510000.0))) tmp = (x - (a * (y / t))) + (y * (z / t)); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.16e+182], N[Not[LessEqual[t, 510000.0]], $MachinePrecision]], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.16 \cdot 10^{+182} \lor \neg \left(t \leq 510000\right):\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.16e182 or 5.1e5 < t Initial program 56.6%
clear-num56.7%
inv-pow56.7%
*-commutative56.7%
associate-/r*67.6%
Applied egg-rr67.6%
Taylor expanded in t around inf 80.5%
sub-neg80.5%
mul-1-neg80.5%
unsub-neg80.5%
associate-/l*83.2%
mul-1-neg83.2%
remove-double-neg83.2%
associate-/l*92.7%
Simplified92.7%
if -1.16e182 < t < 5.1e5Initial program 88.4%
Taylor expanded in t around 0 79.1%
+-commutative79.1%
associate-/l*83.4%
Simplified83.4%
Final simplification87.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.16e+182) (not (<= t 1.2e+116))) (+ (- x (* a (/ y t))) (* y (/ z t))) (+ (+ x y) (* (- z t) (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.16e+182) || !(t <= 1.2e+116)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) + ((z - t) * (y / (t - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.16d+182)) .or. (.not. (t <= 1.2d+116))) then
tmp = (x - (a * (y / t))) + (y * (z / t))
else
tmp = (x + y) + ((z - t) * (y / (t - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.16e+182) || !(t <= 1.2e+116)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) + ((z - t) * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.16e+182) or not (t <= 1.2e+116): tmp = (x - (a * (y / t))) + (y * (z / t)) else: tmp = (x + y) + ((z - t) * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.16e+182) || !(t <= 1.2e+116)) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / t))); else tmp = Float64(Float64(x + y) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.16e+182) || ~((t <= 1.2e+116))) tmp = (x - (a * (y / t))) + (y * (z / t)); else tmp = (x + y) + ((z - t) * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.16e+182], N[Not[LessEqual[t, 1.2e+116]], $MachinePrecision]], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.16 \cdot 10^{+182} \lor \neg \left(t \leq 1.2 \cdot 10^{+116}\right):\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if t < -1.16e182 or 1.2e116 < t Initial program 49.9%
clear-num50.1%
inv-pow50.1%
*-commutative50.1%
associate-/r*61.1%
Applied egg-rr61.1%
Taylor expanded in t around inf 82.8%
sub-neg82.8%
mul-1-neg82.8%
unsub-neg82.8%
associate-/l*86.3%
mul-1-neg86.3%
remove-double-neg86.3%
associate-/l*96.8%
Simplified96.8%
if -1.16e182 < t < 1.2e116Initial program 86.5%
Taylor expanded in y around 0 86.5%
associate-*l/90.2%
Simplified90.2%
Final simplification92.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.4e+184) x (if (<= t 165000000.0) (+ x y) (if (<= t 5.5e+40) (* y (/ z t)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.4e+184) {
tmp = x;
} else if (t <= 165000000.0) {
tmp = x + y;
} else if (t <= 5.5e+40) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.4d+184)) then
tmp = x
else if (t <= 165000000.0d0) then
tmp = x + y
else if (t <= 5.5d+40) then
tmp = y * (z / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.4e+184) {
tmp = x;
} else if (t <= 165000000.0) {
tmp = x + y;
} else if (t <= 5.5e+40) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.4e+184: tmp = x elif t <= 165000000.0: tmp = x + y elif t <= 5.5e+40: tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.4e+184) tmp = x; elseif (t <= 165000000.0) tmp = Float64(x + y); elseif (t <= 5.5e+40) tmp = Float64(y * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.4e+184) tmp = x; elseif (t <= 165000000.0) tmp = x + y; elseif (t <= 5.5e+40) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.4e+184], x, If[LessEqual[t, 165000000.0], N[(x + y), $MachinePrecision], If[LessEqual[t, 5.5e+40], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+184}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 165000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+40}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.39999999999999995e184 or 5.49999999999999974e40 < t Initial program 53.6%
Taylor expanded in x around inf 68.2%
if -1.39999999999999995e184 < t < 1.65e8Initial program 88.4%
Taylor expanded in a around inf 65.6%
+-commutative65.6%
Simplified65.6%
if 1.65e8 < t < 5.49999999999999974e40Initial program 91.4%
sub-neg91.4%
+-commutative91.4%
distribute-frac-neg91.4%
distribute-rgt-neg-out91.4%
associate-/l*92.0%
fma-define91.8%
distribute-frac-neg91.8%
distribute-neg-frac291.8%
sub-neg91.8%
distribute-neg-in91.8%
remove-double-neg91.8%
+-commutative91.8%
sub-neg91.8%
Simplified91.8%
Taylor expanded in z around inf 87.3%
associate-/l*87.7%
Simplified87.7%
Taylor expanded in t around inf 76.0%
associate-/l*76.2%
Simplified76.2%
Final simplification66.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -9.5e+183) x (if (<= t 3700000.0) (+ x y) (if (<= t 4.3e+40) (* (/ y t) z) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.5e+183) {
tmp = x;
} else if (t <= 3700000.0) {
tmp = x + y;
} else if (t <= 4.3e+40) {
tmp = (y / t) * z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-9.5d+183)) then
tmp = x
else if (t <= 3700000.0d0) then
tmp = x + y
else if (t <= 4.3d+40) then
tmp = (y / t) * z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.5e+183) {
tmp = x;
} else if (t <= 3700000.0) {
tmp = x + y;
} else if (t <= 4.3e+40) {
tmp = (y / t) * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9.5e+183: tmp = x elif t <= 3700000.0: tmp = x + y elif t <= 4.3e+40: tmp = (y / t) * z else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.5e+183) tmp = x; elseif (t <= 3700000.0) tmp = Float64(x + y); elseif (t <= 4.3e+40) tmp = Float64(Float64(y / t) * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9.5e+183) tmp = x; elseif (t <= 3700000.0) tmp = x + y; elseif (t <= 4.3e+40) tmp = (y / t) * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.5e+183], x, If[LessEqual[t, 3700000.0], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.3e+40], N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+183}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 3700000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+40}:\\
\;\;\;\;\frac{y}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -9.5000000000000003e183 or 4.3000000000000002e40 < t Initial program 53.6%
Taylor expanded in x around inf 68.2%
if -9.5000000000000003e183 < t < 3.7e6Initial program 88.4%
Taylor expanded in a around inf 65.6%
+-commutative65.6%
Simplified65.6%
if 3.7e6 < t < 4.3000000000000002e40Initial program 91.4%
sub-neg91.4%
+-commutative91.4%
distribute-frac-neg91.4%
distribute-rgt-neg-out91.4%
associate-/l*92.0%
fma-define91.8%
distribute-frac-neg91.8%
distribute-neg-frac291.8%
sub-neg91.8%
distribute-neg-in91.8%
remove-double-neg91.8%
+-commutative91.8%
sub-neg91.8%
Simplified91.8%
Taylor expanded in z around inf 87.3%
associate-/l*87.7%
Simplified87.7%
clear-num87.5%
un-div-inv87.5%
Applied egg-rr87.5%
associate-/r/87.9%
Simplified87.9%
Taylor expanded in t around inf 76.4%
Final simplification66.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.4e-113) (not (<= a 3.4e-28))) (- (+ x y) (* y (/ z a))) (- x (/ (* y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.4e-113) || !(a <= 3.4e-28)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3.4d-113)) .or. (.not. (a <= 3.4d-28))) then
tmp = (x + y) - (y * (z / a))
else
tmp = x - ((y * (a - z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.4e-113) || !(a <= 3.4e-28)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.4e-113) or not (a <= 3.4e-28): tmp = (x + y) - (y * (z / a)) else: tmp = x - ((y * (a - z)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.4e-113) || !(a <= 3.4e-28)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.4e-113) || ~((a <= 3.4e-28))) tmp = (x + y) - (y * (z / a)); else tmp = x - ((y * (a - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.4e-113], N[Not[LessEqual[a, 3.4e-28]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{-113} \lor \neg \left(a \leq 3.4 \cdot 10^{-28}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\end{array}
\end{array}
if a < -3.4000000000000002e-113 or 3.4000000000000001e-28 < a Initial program 81.0%
Taylor expanded in t around 0 80.0%
+-commutative80.0%
associate-/l*86.4%
Simplified86.4%
if -3.4000000000000002e-113 < a < 3.4000000000000001e-28Initial program 69.1%
Taylor expanded in t around inf 81.8%
associate--l+81.8%
distribute-lft-out--81.8%
div-sub81.8%
mul-1-neg81.8%
unsub-neg81.8%
*-commutative81.8%
distribute-lft-out--81.8%
Simplified81.8%
Final simplification84.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6e-8) (not (<= a 1.25e-50))) (+ x y) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6e-8) || !(a <= 1.25e-50)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-6d-8)) .or. (.not. (a <= 1.25d-50))) then
tmp = x + y
else
tmp = x + ((y * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6e-8) || !(a <= 1.25e-50)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6e-8) or not (a <= 1.25e-50): tmp = x + y else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6e-8) || !(a <= 1.25e-50)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6e-8) || ~((a <= 1.25e-50))) tmp = x + y; else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6e-8], N[Not[LessEqual[a, 1.25e-50]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-8} \lor \neg \left(a \leq 1.25 \cdot 10^{-50}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -5.99999999999999946e-8 or 1.24999999999999992e-50 < a Initial program 80.5%
Taylor expanded in a around inf 75.1%
+-commutative75.1%
Simplified75.1%
if -5.99999999999999946e-8 < a < 1.24999999999999992e-50Initial program 71.1%
clear-num71.2%
inv-pow71.2%
*-commutative71.2%
associate-/r*74.7%
Applied egg-rr74.7%
Taylor expanded in t around inf 78.3%
sub-neg78.3%
mul-1-neg78.3%
unsub-neg78.3%
associate-/l*75.8%
mul-1-neg75.8%
remove-double-neg75.8%
associate-/l*81.3%
Simplified81.3%
Taylor expanded in a around 0 77.4%
Final simplification76.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.2e+186) x (if (<= t 3e+164) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.2e+186) {
tmp = x;
} else if (t <= 3e+164) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.2d+186)) then
tmp = x
else if (t <= 3d+164) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.2e+186) {
tmp = x;
} else if (t <= 3e+164) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.2e+186: tmp = x elif t <= 3e+164: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.2e+186) tmp = x; elseif (t <= 3e+164) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.2e+186) tmp = x; elseif (t <= 3e+164) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.2e+186], x, If[LessEqual[t, 3e+164], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+186}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+164}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.19999999999999998e186 or 3.00000000000000001e164 < t Initial program 49.4%
Taylor expanded in x around inf 77.2%
if -1.19999999999999998e186 < t < 3.00000000000000001e164Initial program 84.4%
Taylor expanded in a around inf 61.3%
+-commutative61.3%
Simplified61.3%
Final simplification65.1%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 76.1%
Taylor expanded in x around inf 49.8%
Final simplification49.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024074
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))