
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
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 - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
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 - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+38) (not (<= z 2.45e+222))) (/ (- y (/ x z)) a) (/ (- x (* z y)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+38) || !(z <= 2.45e+222)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (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 <= (-4.8d+38)) .or. (.not. (z <= 2.45d+222))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (z * y)) / (t - (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 <= -4.8e+38) || !(z <= 2.45e+222)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e+38) or not (z <= 2.45e+222): tmp = (y - (x / z)) / a else: tmp = (x - (z * y)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e+38) || !(z <= 2.45e+222)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.8e+38) || ~((z <= 2.45e+222))) tmp = (y - (x / z)) / a; else tmp = (x - (z * y)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e+38], N[Not[LessEqual[z, 2.45e+222]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+38} \lor \neg \left(z \leq 2.45 \cdot 10^{+222}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -4.80000000000000035e38 or 2.44999999999999995e222 < z Initial program 56.3%
*-commutative56.3%
Simplified56.3%
div-sub56.3%
sub-neg56.3%
+-commutative56.3%
*-commutative56.3%
distribute-rgt-neg-in56.3%
fma-def56.3%
associate-/l*70.8%
sub-neg70.8%
+-commutative70.8%
*-commutative70.8%
distribute-rgt-neg-in70.8%
fma-def70.9%
Applied egg-rr70.9%
Taylor expanded in a around inf 86.7%
distribute-lft-out--86.7%
associate-*r/86.7%
mul-1-neg86.7%
Simplified86.7%
if -4.80000000000000035e38 < z < 2.44999999999999995e222Initial program 97.3%
Final simplification94.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* z y)) t)) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -1.15e+34)
t_2
(if (<= z -2.5e-77)
t_1
(if (<= z -3.2e-135)
(- (/ y a) (/ (/ x a) z))
(if (<= z -1.36e-195)
t_1
(if (<= z 3.5e+68) (/ x (- t (* z a))) t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (z * y)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.15e+34) {
tmp = t_2;
} else if (z <= -2.5e-77) {
tmp = t_1;
} else if (z <= -3.2e-135) {
tmp = (y / a) - ((x / a) / z);
} else if (z <= -1.36e-195) {
tmp = t_1;
} else if (z <= 3.5e+68) {
tmp = x / (t - (z * a));
} else {
tmp = t_2;
}
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 = (x - (z * y)) / t
t_2 = (y - (x / z)) / a
if (z <= (-1.15d+34)) then
tmp = t_2
else if (z <= (-2.5d-77)) then
tmp = t_1
else if (z <= (-3.2d-135)) then
tmp = (y / a) - ((x / a) / z)
else if (z <= (-1.36d-195)) then
tmp = t_1
else if (z <= 3.5d+68) then
tmp = x / (t - (z * a))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (z * y)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.15e+34) {
tmp = t_2;
} else if (z <= -2.5e-77) {
tmp = t_1;
} else if (z <= -3.2e-135) {
tmp = (y / a) - ((x / a) / z);
} else if (z <= -1.36e-195) {
tmp = t_1;
} else if (z <= 3.5e+68) {
tmp = x / (t - (z * a));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (z * y)) / t t_2 = (y - (x / z)) / a tmp = 0 if z <= -1.15e+34: tmp = t_2 elif z <= -2.5e-77: tmp = t_1 elif z <= -3.2e-135: tmp = (y / a) - ((x / a) / z) elif z <= -1.36e-195: tmp = t_1 elif z <= 3.5e+68: tmp = x / (t - (z * a)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(z * y)) / t) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -1.15e+34) tmp = t_2; elseif (z <= -2.5e-77) tmp = t_1; elseif (z <= -3.2e-135) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); elseif (z <= -1.36e-195) tmp = t_1; elseif (z <= 3.5e+68) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (z * y)) / t; t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -1.15e+34) tmp = t_2; elseif (z <= -2.5e-77) tmp = t_1; elseif (z <= -3.2e-135) tmp = (y / a) - ((x / a) / z); elseif (z <= -1.36e-195) tmp = t_1; elseif (z <= 3.5e+68) tmp = x / (t - (z * a)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1.15e+34], t$95$2, If[LessEqual[z, -2.5e-77], t$95$1, If[LessEqual[z, -3.2e-135], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.36e-195], t$95$1, If[LessEqual[z, 3.5e+68], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - z \cdot y}{t}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-135}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{elif}\;z \leq -1.36 \cdot 10^{-195}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+68}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.1499999999999999e34 or 3.49999999999999977e68 < z Initial program 65.4%
*-commutative65.4%
Simplified65.4%
div-sub65.4%
sub-neg65.4%
+-commutative65.4%
*-commutative65.4%
distribute-rgt-neg-in65.4%
fma-def65.4%
associate-/l*76.6%
sub-neg76.6%
+-commutative76.6%
*-commutative76.6%
distribute-rgt-neg-in76.6%
fma-def76.6%
Applied egg-rr76.6%
Taylor expanded in a around inf 80.6%
distribute-lft-out--80.6%
associate-*r/80.6%
mul-1-neg80.6%
Simplified80.6%
if -1.1499999999999999e34 < z < -2.49999999999999982e-77 or -3.2e-135 < z < -1.36e-195Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 81.6%
if -2.49999999999999982e-77 < z < -3.2e-135Initial program 99.8%
*-commutative99.8%
Simplified99.8%
div-sub99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
associate-/l*95.9%
sub-neg95.9%
+-commutative95.9%
*-commutative95.9%
distribute-rgt-neg-in95.9%
fma-def95.9%
Applied egg-rr95.9%
Taylor expanded in t around 0 72.7%
cancel-sign-sub-inv72.7%
metadata-eval72.7%
*-lft-identity72.7%
+-commutative72.7%
neg-mul-172.7%
unsub-neg72.7%
associate-/r*72.8%
Simplified72.8%
if -1.36e-195 < z < 3.49999999999999977e68Initial program 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around inf 78.0%
*-commutative78.0%
Simplified78.0%
Final simplification79.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= z -3.2e+43)
(/ y a)
(if (<= z -3.5e-136)
t_1
(if (<= z -9e-196)
(/ (- x (* z y)) t)
(if (<= z 2.5e+111) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -3.2e+43) {
tmp = y / a;
} else if (z <= -3.5e-136) {
tmp = t_1;
} else if (z <= -9e-196) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.5e+111) {
tmp = t_1;
} else {
tmp = y / 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) :: t_1
real(8) :: tmp
t_1 = x / (t - (z * a))
if (z <= (-3.2d+43)) then
tmp = y / a
else if (z <= (-3.5d-136)) then
tmp = t_1
else if (z <= (-9d-196)) then
tmp = (x - (z * y)) / t
else if (z <= 2.5d+111) then
tmp = t_1
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -3.2e+43) {
tmp = y / a;
} else if (z <= -3.5e-136) {
tmp = t_1;
} else if (z <= -9e-196) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.5e+111) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if z <= -3.2e+43: tmp = y / a elif z <= -3.5e-136: tmp = t_1 elif z <= -9e-196: tmp = (x - (z * y)) / t elif z <= 2.5e+111: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (z <= -3.2e+43) tmp = Float64(y / a); elseif (z <= -3.5e-136) tmp = t_1; elseif (z <= -9e-196) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 2.5e+111) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (z <= -3.2e+43) tmp = y / a; elseif (z <= -3.5e-136) tmp = t_1; elseif (z <= -9e-196) tmp = (x - (z * y)) / t; elseif (z <= 2.5e+111) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+43], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.5e-136], t$95$1, If[LessEqual[z, -9e-196], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.5e+111], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+43}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-196}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+111}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.20000000000000014e43 or 2.4999999999999998e111 < z Initial program 62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in z around inf 71.0%
if -3.20000000000000014e43 < z < -3.50000000000000029e-136 or -9e-196 < z < 2.4999999999999998e111Initial program 98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in x around inf 71.1%
*-commutative71.1%
Simplified71.1%
if -3.50000000000000029e-136 < z < -9e-196Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
Final simplification72.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -2.6e+38)
t_2
(if (<= z -1.9e-135)
t_1
(if (<= z -1.4e-195)
(/ (- x (* z y)) t)
(if (<= z 3.5e+68) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -2.6e+38) {
tmp = t_2;
} else if (z <= -1.9e-135) {
tmp = t_1;
} else if (z <= -1.4e-195) {
tmp = (x - (z * y)) / t;
} else if (z <= 3.5e+68) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = x / (t - (z * a))
t_2 = (y - (x / z)) / a
if (z <= (-2.6d+38)) then
tmp = t_2
else if (z <= (-1.9d-135)) then
tmp = t_1
else if (z <= (-1.4d-195)) then
tmp = (x - (z * y)) / t
else if (z <= 3.5d+68) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -2.6e+38) {
tmp = t_2;
} else if (z <= -1.9e-135) {
tmp = t_1;
} else if (z <= -1.4e-195) {
tmp = (x - (z * y)) / t;
} else if (z <= 3.5e+68) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) t_2 = (y - (x / z)) / a tmp = 0 if z <= -2.6e+38: tmp = t_2 elif z <= -1.9e-135: tmp = t_1 elif z <= -1.4e-195: tmp = (x - (z * y)) / t elif z <= 3.5e+68: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -2.6e+38) tmp = t_2; elseif (z <= -1.9e-135) tmp = t_1; elseif (z <= -1.4e-195) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 3.5e+68) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -2.6e+38) tmp = t_2; elseif (z <= -1.9e-135) tmp = t_1; elseif (z <= -1.4e-195) tmp = (x - (z * y)) / t; elseif (z <= 3.5e+68) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -2.6e+38], t$95$2, If[LessEqual[z, -1.9e-135], t$95$1, If[LessEqual[z, -1.4e-195], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.5e+68], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-135}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-195}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.5999999999999999e38 or 3.49999999999999977e68 < z Initial program 65.0%
*-commutative65.0%
Simplified65.0%
div-sub65.0%
sub-neg65.0%
+-commutative65.0%
*-commutative65.0%
distribute-rgt-neg-in65.0%
fma-def65.0%
associate-/l*76.4%
sub-neg76.4%
+-commutative76.4%
*-commutative76.4%
distribute-rgt-neg-in76.4%
fma-def76.4%
Applied egg-rr76.4%
Taylor expanded in a around inf 80.4%
distribute-lft-out--80.4%
associate-*r/80.4%
mul-1-neg80.4%
Simplified80.4%
if -2.5999999999999999e38 < z < -1.9000000000000001e-135 or -1.40000000000000002e-195 < z < 3.49999999999999977e68Initial program 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in x around inf 72.3%
*-commutative72.3%
Simplified72.3%
if -1.9000000000000001e-135 < z < -1.40000000000000002e-195Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
Final simplification76.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.1e+33)
(/ y a)
(if (<= z -0.0025)
(/ x t)
(if (<= z -2.9e-40)
(* y (- (/ z t)))
(if (<= z -1.85e-137)
(/ (/ (- x) a) z)
(if (<= z 3e+52) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.1e+33) {
tmp = y / a;
} else if (z <= -0.0025) {
tmp = x / t;
} else if (z <= -2.9e-40) {
tmp = y * -(z / t);
} else if (z <= -1.85e-137) {
tmp = (-x / a) / z;
} else if (z <= 3e+52) {
tmp = x / t;
} else {
tmp = y / 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 <= (-5.1d+33)) then
tmp = y / a
else if (z <= (-0.0025d0)) then
tmp = x / t
else if (z <= (-2.9d-40)) then
tmp = y * -(z / t)
else if (z <= (-1.85d-137)) then
tmp = (-x / a) / z
else if (z <= 3d+52) then
tmp = x / t
else
tmp = y / 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 <= -5.1e+33) {
tmp = y / a;
} else if (z <= -0.0025) {
tmp = x / t;
} else if (z <= -2.9e-40) {
tmp = y * -(z / t);
} else if (z <= -1.85e-137) {
tmp = (-x / a) / z;
} else if (z <= 3e+52) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.1e+33: tmp = y / a elif z <= -0.0025: tmp = x / t elif z <= -2.9e-40: tmp = y * -(z / t) elif z <= -1.85e-137: tmp = (-x / a) / z elif z <= 3e+52: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.1e+33) tmp = Float64(y / a); elseif (z <= -0.0025) tmp = Float64(x / t); elseif (z <= -2.9e-40) tmp = Float64(y * Float64(-Float64(z / t))); elseif (z <= -1.85e-137) tmp = Float64(Float64(Float64(-x) / a) / z); elseif (z <= 3e+52) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.1e+33) tmp = y / a; elseif (z <= -0.0025) tmp = x / t; elseif (z <= -2.9e-40) tmp = y * -(z / t); elseif (z <= -1.85e-137) tmp = (-x / a) / z; elseif (z <= 3e+52) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.1e+33], N[(y / a), $MachinePrecision], If[LessEqual[z, -0.0025], N[(x / t), $MachinePrecision], If[LessEqual[z, -2.9e-40], N[(y * (-N[(z / t), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, -1.85e-137], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3e+52], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{+33}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -0.0025:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-40}:\\
\;\;\;\;y \cdot \left(-\frac{z}{t}\right)\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-137}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+52}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.0999999999999999e33 or 3e52 < z Initial program 66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in z around inf 65.8%
if -5.0999999999999999e33 < z < -0.00250000000000000005 or -1.85e-137 < z < 3e52Initial program 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in z around 0 57.2%
if -0.00250000000000000005 < z < -2.8999999999999999e-40Initial program 100.0%
*-commutative100.0%
Simplified100.0%
sub-neg100.0%
+-commutative100.0%
distribute-lft-neg-in100.0%
fma-def100.0%
Applied egg-rr100.0%
div-sub88.9%
fma-udef88.9%
distribute-lft-neg-in88.9%
*-commutative88.9%
distribute-rgt-neg-in88.9%
fma-udef88.9%
add-sqr-sqrt88.9%
sqrt-unprod88.9%
sqr-neg88.9%
sqrt-unprod0.0%
add-sqr-sqrt88.9%
associate-/l*88.5%
fma-udef88.5%
distribute-lft-neg-in88.5%
*-commutative88.5%
distribute-rgt-neg-in88.5%
fma-udef88.5%
div-inv88.5%
clear-num88.7%
Applied egg-rr56.1%
Taylor expanded in x around 0 56.8%
mul-1-neg56.8%
associate-*r/56.6%
+-commutative56.6%
fma-udef56.6%
distribute-lft-neg-in56.6%
fma-udef56.6%
*-commutative56.6%
fma-def56.6%
Simplified56.6%
Taylor expanded in z around 0 56.4%
if -2.8999999999999999e-40 < z < -1.85e-137Initial program 99.7%
*-commutative99.7%
Simplified99.7%
div-sub99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-def99.7%
associate-/l*96.9%
sub-neg96.9%
+-commutative96.9%
*-commutative96.9%
distribute-rgt-neg-in96.9%
fma-def96.9%
Applied egg-rr96.9%
Taylor expanded in a around inf 55.8%
distribute-lft-out--55.8%
associate-*r/55.8%
mul-1-neg55.8%
Simplified55.8%
Taylor expanded in x around inf 43.7%
associate-/r*43.8%
Simplified43.8%
Final simplification58.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.3e+33)
(/ y a)
(if (<= z -0.00022)
(/ x t)
(if (<= z -9e-37)
(/ (* z (- y)) t)
(if (<= z -3e-135)
(/ (/ (- x) a) z)
(if (<= z 3e+52) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+33) {
tmp = y / a;
} else if (z <= -0.00022) {
tmp = x / t;
} else if (z <= -9e-37) {
tmp = (z * -y) / t;
} else if (z <= -3e-135) {
tmp = (-x / a) / z;
} else if (z <= 3e+52) {
tmp = x / t;
} else {
tmp = y / 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 <= (-2.3d+33)) then
tmp = y / a
else if (z <= (-0.00022d0)) then
tmp = x / t
else if (z <= (-9d-37)) then
tmp = (z * -y) / t
else if (z <= (-3d-135)) then
tmp = (-x / a) / z
else if (z <= 3d+52) then
tmp = x / t
else
tmp = y / 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 <= -2.3e+33) {
tmp = y / a;
} else if (z <= -0.00022) {
tmp = x / t;
} else if (z <= -9e-37) {
tmp = (z * -y) / t;
} else if (z <= -3e-135) {
tmp = (-x / a) / z;
} else if (z <= 3e+52) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.3e+33: tmp = y / a elif z <= -0.00022: tmp = x / t elif z <= -9e-37: tmp = (z * -y) / t elif z <= -3e-135: tmp = (-x / a) / z elif z <= 3e+52: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e+33) tmp = Float64(y / a); elseif (z <= -0.00022) tmp = Float64(x / t); elseif (z <= -9e-37) tmp = Float64(Float64(z * Float64(-y)) / t); elseif (z <= -3e-135) tmp = Float64(Float64(Float64(-x) / a) / z); elseif (z <= 3e+52) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.3e+33) tmp = y / a; elseif (z <= -0.00022) tmp = x / t; elseif (z <= -9e-37) tmp = (z * -y) / t; elseif (z <= -3e-135) tmp = (-x / a) / z; elseif (z <= 3e+52) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e+33], N[(y / a), $MachinePrecision], If[LessEqual[z, -0.00022], N[(x / t), $MachinePrecision], If[LessEqual[z, -9e-37], N[(N[(z * (-y)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -3e-135], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3e+52], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+33}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -0.00022:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-37}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-135}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+52}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.30000000000000011e33 or 3e52 < z Initial program 66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in z around inf 65.8%
if -2.30000000000000011e33 < z < -2.20000000000000008e-4 or -3.00000000000000012e-135 < z < 3e52Initial program 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in z around 0 57.2%
if -2.20000000000000008e-4 < z < -9.00000000000000081e-37Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 89.4%
associate-*r/89.4%
associate-*r*89.4%
neg-mul-189.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in z around 0 56.6%
associate-*r/56.6%
associate-*r*56.6%
mul-1-neg56.6%
Simplified56.6%
if -9.00000000000000081e-37 < z < -3.00000000000000012e-135Initial program 99.7%
*-commutative99.7%
Simplified99.7%
div-sub99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-def99.7%
associate-/l*96.9%
sub-neg96.9%
+-commutative96.9%
*-commutative96.9%
distribute-rgt-neg-in96.9%
fma-def96.9%
Applied egg-rr96.9%
Taylor expanded in a around inf 55.8%
distribute-lft-out--55.8%
associate-*r/55.8%
mul-1-neg55.8%
Simplified55.8%
Taylor expanded in x around inf 43.7%
associate-/r*43.8%
Simplified43.8%
Final simplification58.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.3e+47) (not (<= z 1.76e+115))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.3e+47) || !(z <= 1.76e+115)) {
tmp = y / a;
} else {
tmp = x / (t - (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 <= (-5.3d+47)) .or. (.not. (z <= 1.76d+115))) then
tmp = y / a
else
tmp = x / (t - (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 <= -5.3e+47) || !(z <= 1.76e+115)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.3e+47) or not (z <= 1.76e+115): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.3e+47) || !(z <= 1.76e+115)) tmp = Float64(y / a); else tmp = Float64(x / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.3e+47) || ~((z <= 1.76e+115))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.3e+47], N[Not[LessEqual[z, 1.76e+115]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{+47} \lor \neg \left(z \leq 1.76 \cdot 10^{+115}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -5.3e47 or 1.76e115 < z Initial program 62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in z around inf 71.0%
if -5.3e47 < z < 1.76e115Initial program 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in x around inf 70.4%
*-commutative70.4%
Simplified70.4%
Final simplification70.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.8e+39) (/ y a) (if (<= z -2.1e-138) (/ (/ (- x) a) z) (if (<= z 3e+52) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e+39) {
tmp = y / a;
} else if (z <= -2.1e-138) {
tmp = (-x / a) / z;
} else if (z <= 3e+52) {
tmp = x / t;
} else {
tmp = y / 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 <= (-6.8d+39)) then
tmp = y / a
else if (z <= (-2.1d-138)) then
tmp = (-x / a) / z
else if (z <= 3d+52) then
tmp = x / t
else
tmp = y / 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 <= -6.8e+39) {
tmp = y / a;
} else if (z <= -2.1e-138) {
tmp = (-x / a) / z;
} else if (z <= 3e+52) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.8e+39: tmp = y / a elif z <= -2.1e-138: tmp = (-x / a) / z elif z <= 3e+52: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e+39) tmp = Float64(y / a); elseif (z <= -2.1e-138) tmp = Float64(Float64(Float64(-x) / a) / z); elseif (z <= 3e+52) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.8e+39) tmp = y / a; elseif (z <= -2.1e-138) tmp = (-x / a) / z; elseif (z <= 3e+52) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e+39], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.1e-138], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3e+52], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+39}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-138}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+52}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.7999999999999998e39 or 3e52 < z Initial program 65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in z around inf 67.0%
if -6.7999999999999998e39 < z < -2.09999999999999986e-138Initial program 99.8%
*-commutative99.8%
Simplified99.8%
div-sub97.8%
sub-neg97.8%
+-commutative97.8%
*-commutative97.8%
distribute-rgt-neg-in97.8%
fma-def97.8%
associate-/l*95.9%
sub-neg95.9%
+-commutative95.9%
*-commutative95.9%
distribute-rgt-neg-in95.9%
fma-def95.9%
Applied egg-rr95.9%
Taylor expanded in a around inf 52.4%
distribute-lft-out--52.4%
associate-*r/52.4%
mul-1-neg52.4%
Simplified52.4%
Taylor expanded in x around inf 39.0%
associate-/r*39.1%
Simplified39.1%
if -2.09999999999999986e-138 < z < 3e52Initial program 99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in z around 0 56.4%
Final simplification57.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.7e+32) (not (<= z 3e+52))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.7e+32) || !(z <= 3e+52)) {
tmp = y / a;
} else {
tmp = x / 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 ((z <= (-4.7d+32)) .or. (.not. (z <= 3d+52))) then
tmp = y / a
else
tmp = x / t
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.7e+32) || !(z <= 3e+52)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.7e+32) or not (z <= 3e+52): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.7e+32) || !(z <= 3e+52)) tmp = Float64(y / a); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.7e+32) || ~((z <= 3e+52))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.7e+32], N[Not[LessEqual[z, 3e+52]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+32} \lor \neg \left(z \leq 3 \cdot 10^{+52}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -4.70000000000000023e32 or 3e52 < z Initial program 66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in z around inf 65.8%
if -4.70000000000000023e32 < z < 3e52Initial program 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in z around 0 48.6%
Final simplification55.3%
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
return x / 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 / t
end function
public static double code(double x, double y, double z, double t, double a) {
return x / t;
}
def code(x, y, z, t, a): return x / t
function code(x, y, z, t, a) return Float64(x / t) end
function tmp = code(x, y, z, t, a) tmp = x / t; end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t}
\end{array}
Initial program 86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in z around 0 33.7%
Final simplification33.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
(if (< z -32113435955957344.0)
t_2
(if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
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 = t - (a * z)
t_2 = (x / t_1) - (y / ((t / z) - a))
if (z < (-32113435955957344.0d0)) then
tmp = t_2
else if (z < 3.5139522372978296d-86) then
tmp = (x - (y * z)) * (1.0d0 / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) t_2 = (x / t_1) - (y / ((t / z) - a)) tmp = 0 if z < -32113435955957344.0: tmp = t_2 elif z < 3.5139522372978296e-86: tmp = (x - (y * z)) * (1.0 / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))) tmp = 0.0 if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); t_2 = (x / t_1) - (y / ((t / z) - a)); tmp = 0.0; if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = (x - (y * z)) * (1.0 / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023318
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))