
(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 12 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 -2.1e+107) (not (<= z 2.7e+135))) (/ (- 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 <= -2.1e+107) || !(z <= 2.7e+135)) {
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 <= (-2.1d+107)) .or. (.not. (z <= 2.7d+135))) 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 <= -2.1e+107) || !(z <= 2.7e+135)) {
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 <= -2.1e+107) or not (z <= 2.7e+135): 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 <= -2.1e+107) || !(z <= 2.7e+135)) 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 <= -2.1e+107) || ~((z <= 2.7e+135))) 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, -2.1e+107], N[Not[LessEqual[z, 2.7e+135]], $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 -2.1 \cdot 10^{+107} \lor \neg \left(z \leq 2.7 \cdot 10^{+135}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -2.1e107 or 2.69999999999999985e135 < z Initial program 57.2%
*-commutative57.2%
Simplified57.2%
Taylor expanded in t around 0 48.2%
associate-*r/48.2%
*-commutative48.2%
associate-/r*66.0%
associate-*r/66.0%
mul-1-neg66.0%
div-sub66.0%
associate-/l*85.6%
*-inverses85.6%
Simplified85.6%
Taylor expanded in x around 0 82.4%
+-commutative82.4%
mul-1-neg82.4%
sub-neg82.4%
associate-/l/85.6%
div-sub85.6%
Simplified85.6%
if -2.1e107 < z < 2.69999999999999985e135Initial program 97.5%
Final simplification93.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -9e+29)
t_1
(if (<= z -3.5e-27)
(/ (- x (* z y)) t)
(if (<= z -2e-84)
t_1
(if (<= z 1.7e-7)
(/ x (- t (* z a)))
(if (<= z 5.6e+77) (* z (- (/ x (* z t)) (/ y t))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -9e+29) {
tmp = t_1;
} else if (z <= -3.5e-27) {
tmp = (x - (z * y)) / t;
} else if (z <= -2e-84) {
tmp = t_1;
} else if (z <= 1.7e-7) {
tmp = x / (t - (z * a));
} else if (z <= 5.6e+77) {
tmp = z * ((x / (z * t)) - (y / 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) :: tmp
t_1 = (y - (x / z)) / a
if (z <= (-9d+29)) then
tmp = t_1
else if (z <= (-3.5d-27)) then
tmp = (x - (z * y)) / t
else if (z <= (-2d-84)) then
tmp = t_1
else if (z <= 1.7d-7) then
tmp = x / (t - (z * a))
else if (z <= 5.6d+77) then
tmp = z * ((x / (z * t)) - (y / 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)) / a;
double tmp;
if (z <= -9e+29) {
tmp = t_1;
} else if (z <= -3.5e-27) {
tmp = (x - (z * y)) / t;
} else if (z <= -2e-84) {
tmp = t_1;
} else if (z <= 1.7e-7) {
tmp = x / (t - (z * a));
} else if (z <= 5.6e+77) {
tmp = z * ((x / (z * t)) - (y / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -9e+29: tmp = t_1 elif z <= -3.5e-27: tmp = (x - (z * y)) / t elif z <= -2e-84: tmp = t_1 elif z <= 1.7e-7: tmp = x / (t - (z * a)) elif z <= 5.6e+77: tmp = z * ((x / (z * t)) - (y / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -9e+29) tmp = t_1; elseif (z <= -3.5e-27) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= -2e-84) tmp = t_1; elseif (z <= 1.7e-7) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 5.6e+77) tmp = Float64(z * Float64(Float64(x / Float64(z * t)) - Float64(y / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; tmp = 0.0; if (z <= -9e+29) tmp = t_1; elseif (z <= -3.5e-27) tmp = (x - (z * y)) / t; elseif (z <= -2e-84) tmp = t_1; elseif (z <= 1.7e-7) tmp = x / (t - (z * a)); elseif (z <= 5.6e+77) tmp = z * ((x / (z * t)) - (y / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -9e+29], t$95$1, If[LessEqual[z, -3.5e-27], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -2e-84], t$95$1, If[LessEqual[z, 1.7e-7], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+77], N[(z * N[(N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-27}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-84}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+77}:\\
\;\;\;\;z \cdot \left(\frac{x}{z \cdot t} - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.0000000000000005e29 or -3.5000000000000001e-27 < z < -2.0000000000000001e-84 or 5.60000000000000001e77 < z Initial program 67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in t around 0 53.8%
associate-*r/53.8%
*-commutative53.8%
associate-/r*68.2%
associate-*r/68.2%
mul-1-neg68.2%
div-sub68.2%
associate-/l*82.4%
*-inverses82.4%
Simplified82.4%
Taylor expanded in x around 0 78.7%
+-commutative78.7%
mul-1-neg78.7%
sub-neg78.7%
associate-/l/82.4%
div-sub82.4%
Simplified82.4%
if -9.0000000000000005e29 < z < -3.5000000000000001e-27Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 90.2%
if -2.0000000000000001e-84 < z < 1.69999999999999987e-7Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 82.6%
*-commutative82.6%
Simplified82.6%
if 1.69999999999999987e-7 < z < 5.60000000000000001e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 73.7%
Taylor expanded in z around inf 73.7%
+-commutative73.7%
mul-1-neg73.7%
unsub-neg73.7%
*-commutative73.7%
Simplified73.7%
Final simplification82.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (* z (- a)))))
(if (<= z -6.6e+106)
(/ y a)
(if (<= z -5.8e+39)
t_1
(if (<= z -3.6e+20)
(/ y a)
(if (<= z -1.36e-18)
(* y (/ z (- t)))
(if (<= z -4.1e-109) t_1 (if (<= z 8.8e+77) (/ x t) (/ y a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (z * -a);
double tmp;
if (z <= -6.6e+106) {
tmp = y / a;
} else if (z <= -5.8e+39) {
tmp = t_1;
} else if (z <= -3.6e+20) {
tmp = y / a;
} else if (z <= -1.36e-18) {
tmp = y * (z / -t);
} else if (z <= -4.1e-109) {
tmp = t_1;
} else if (z <= 8.8e+77) {
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) :: t_1
real(8) :: tmp
t_1 = x / (z * -a)
if (z <= (-6.6d+106)) then
tmp = y / a
else if (z <= (-5.8d+39)) then
tmp = t_1
else if (z <= (-3.6d+20)) then
tmp = y / a
else if (z <= (-1.36d-18)) then
tmp = y * (z / -t)
else if (z <= (-4.1d-109)) then
tmp = t_1
else if (z <= 8.8d+77) 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 t_1 = x / (z * -a);
double tmp;
if (z <= -6.6e+106) {
tmp = y / a;
} else if (z <= -5.8e+39) {
tmp = t_1;
} else if (z <= -3.6e+20) {
tmp = y / a;
} else if (z <= -1.36e-18) {
tmp = y * (z / -t);
} else if (z <= -4.1e-109) {
tmp = t_1;
} else if (z <= 8.8e+77) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (z * -a) tmp = 0 if z <= -6.6e+106: tmp = y / a elif z <= -5.8e+39: tmp = t_1 elif z <= -3.6e+20: tmp = y / a elif z <= -1.36e-18: tmp = y * (z / -t) elif z <= -4.1e-109: tmp = t_1 elif z <= 8.8e+77: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(z * Float64(-a))) tmp = 0.0 if (z <= -6.6e+106) tmp = Float64(y / a); elseif (z <= -5.8e+39) tmp = t_1; elseif (z <= -3.6e+20) tmp = Float64(y / a); elseif (z <= -1.36e-18) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= -4.1e-109) tmp = t_1; elseif (z <= 8.8e+77) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (z * -a); tmp = 0.0; if (z <= -6.6e+106) tmp = y / a; elseif (z <= -5.8e+39) tmp = t_1; elseif (z <= -3.6e+20) tmp = y / a; elseif (z <= -1.36e-18) tmp = y * (z / -t); elseif (z <= -4.1e-109) tmp = t_1; elseif (z <= 8.8e+77) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+106], N[(y / a), $MachinePrecision], If[LessEqual[z, -5.8e+39], t$95$1, If[LessEqual[z, -3.6e+20], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.36e-18], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.1e-109], t$95$1, If[LessEqual[z, 8.8e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(-a\right)}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{+20}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.36 \cdot 10^{-18}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+77}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.60000000000000015e106 or -5.80000000000000059e39 < z < -3.6e20 or 8.8000000000000002e77 < z Initial program 60.9%
*-commutative60.9%
Simplified60.9%
Taylor expanded in z around inf 74.0%
if -6.60000000000000015e106 < z < -5.80000000000000059e39 or -1.3600000000000001e-18 < z < -4.1000000000000002e-109Initial program 90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in x around inf 62.1%
*-commutative62.1%
Simplified62.1%
Taylor expanded in t around 0 50.3%
associate-*r/50.3%
neg-mul-150.3%
Simplified50.3%
if -3.6e20 < z < -1.3600000000000001e-18Initial program 99.8%
*-commutative99.8%
Simplified99.8%
clear-num98.8%
associate-/r/99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in a around 0 90.0%
Taylor expanded in x around 0 60.3%
mul-1-neg60.3%
associate-/l*60.3%
distribute-rgt-neg-in60.3%
distribute-neg-frac260.3%
Simplified60.3%
if -4.1000000000000002e-109 < z < 8.8000000000000002e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.4%
Final simplification63.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* z y)) t)) (t_2 (/ x (- t (* z a)))))
(if (<= z -6.6e+106)
(/ y a)
(if (<= z -3.4e-109)
t_2
(if (<= z -2.2e-174)
t_1
(if (<= z 6e-16) t_2 (if (<= z 5.6e+77) t_1 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (z * y)) / t;
double t_2 = x / (t - (z * a));
double tmp;
if (z <= -6.6e+106) {
tmp = y / a;
} else if (z <= -3.4e-109) {
tmp = t_2;
} else if (z <= -2.2e-174) {
tmp = t_1;
} else if (z <= 6e-16) {
tmp = t_2;
} else if (z <= 5.6e+77) {
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) :: t_2
real(8) :: tmp
t_1 = (x - (z * y)) / t
t_2 = x / (t - (z * a))
if (z <= (-6.6d+106)) then
tmp = y / a
else if (z <= (-3.4d-109)) then
tmp = t_2
else if (z <= (-2.2d-174)) then
tmp = t_1
else if (z <= 6d-16) then
tmp = t_2
else if (z <= 5.6d+77) 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 - (z * y)) / t;
double t_2 = x / (t - (z * a));
double tmp;
if (z <= -6.6e+106) {
tmp = y / a;
} else if (z <= -3.4e-109) {
tmp = t_2;
} else if (z <= -2.2e-174) {
tmp = t_1;
} else if (z <= 6e-16) {
tmp = t_2;
} else if (z <= 5.6e+77) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (z * y)) / t t_2 = x / (t - (z * a)) tmp = 0 if z <= -6.6e+106: tmp = y / a elif z <= -3.4e-109: tmp = t_2 elif z <= -2.2e-174: tmp = t_1 elif z <= 6e-16: tmp = t_2 elif z <= 5.6e+77: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(z * y)) / t) t_2 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (z <= -6.6e+106) tmp = Float64(y / a); elseif (z <= -3.4e-109) tmp = t_2; elseif (z <= -2.2e-174) tmp = t_1; elseif (z <= 6e-16) tmp = t_2; elseif (z <= 5.6e+77) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (z * y)) / t; t_2 = x / (t - (z * a)); tmp = 0.0; if (z <= -6.6e+106) tmp = y / a; elseif (z <= -3.4e-109) tmp = t_2; elseif (z <= -2.2e-174) tmp = t_1; elseif (z <= 6e-16) tmp = t_2; elseif (z <= 5.6e+77) tmp = t_1; else tmp = y / a; 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[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+106], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.4e-109], t$95$2, If[LessEqual[z, -2.2e-174], t$95$1, If[LessEqual[z, 6e-16], t$95$2, If[LessEqual[z, 5.6e+77], t$95$1, N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - z \cdot y}{t}\\
t_2 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-109}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-174}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-16}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.60000000000000015e106 or 5.60000000000000001e77 < z Initial program 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in z around inf 73.8%
if -6.60000000000000015e106 < z < -3.40000000000000012e-109 or -2.20000000000000022e-174 < z < 5.99999999999999987e-16Initial program 97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
Simplified76.7%
if -3.40000000000000012e-109 < z < -2.20000000000000022e-174 or 5.99999999999999987e-16 < z < 5.60000000000000001e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 82.1%
Final simplification76.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* z y)) t)) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -2.5e+34)
t_2
(if (<= z -1.92e-19)
t_1
(if (<= z -2e-84)
t_2
(if (<= z 6.8e-16)
(/ x (- t (* z a)))
(if (<= z 4.3e+77) t_1 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 <= -2.5e+34) {
tmp = t_2;
} else if (z <= -1.92e-19) {
tmp = t_1;
} else if (z <= -2e-84) {
tmp = t_2;
} else if (z <= 6.8e-16) {
tmp = x / (t - (z * a));
} else if (z <= 4.3e+77) {
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 - (z * y)) / t
t_2 = (y - (x / z)) / a
if (z <= (-2.5d+34)) then
tmp = t_2
else if (z <= (-1.92d-19)) then
tmp = t_1
else if (z <= (-2d-84)) then
tmp = t_2
else if (z <= 6.8d-16) then
tmp = x / (t - (z * a))
else if (z <= 4.3d+77) 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 - (z * y)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -2.5e+34) {
tmp = t_2;
} else if (z <= -1.92e-19) {
tmp = t_1;
} else if (z <= -2e-84) {
tmp = t_2;
} else if (z <= 6.8e-16) {
tmp = x / (t - (z * a));
} else if (z <= 4.3e+77) {
tmp = t_1;
} 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 <= -2.5e+34: tmp = t_2 elif z <= -1.92e-19: tmp = t_1 elif z <= -2e-84: tmp = t_2 elif z <= 6.8e-16: tmp = x / (t - (z * a)) elif z <= 4.3e+77: tmp = t_1 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 <= -2.5e+34) tmp = t_2; elseif (z <= -1.92e-19) tmp = t_1; elseif (z <= -2e-84) tmp = t_2; elseif (z <= 6.8e-16) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 4.3e+77) tmp = t_1; 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 <= -2.5e+34) tmp = t_2; elseif (z <= -1.92e-19) tmp = t_1; elseif (z <= -2e-84) tmp = t_2; elseif (z <= 6.8e-16) tmp = x / (t - (z * a)); elseif (z <= 4.3e+77) tmp = t_1; 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, -2.5e+34], t$95$2, If[LessEqual[z, -1.92e-19], t$95$1, If[LessEqual[z, -2e-84], t$95$2, If[LessEqual[z, 6.8e-16], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e+77], t$95$1, 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 -2.5 \cdot 10^{+34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.92 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-84}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.4999999999999999e34 or -1.91999999999999994e-19 < z < -2.0000000000000001e-84 or 4.29999999999999991e77 < z Initial program 67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in t around 0 53.8%
associate-*r/53.8%
*-commutative53.8%
associate-/r*68.2%
associate-*r/68.2%
mul-1-neg68.2%
div-sub68.2%
associate-/l*82.4%
*-inverses82.4%
Simplified82.4%
Taylor expanded in x around 0 78.7%
+-commutative78.7%
mul-1-neg78.7%
sub-neg78.7%
associate-/l/82.4%
div-sub82.4%
Simplified82.4%
if -2.4999999999999999e34 < z < -1.91999999999999994e-19 or 6.8e-16 < z < 4.29999999999999991e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 80.5%
if -2.0000000000000001e-84 < z < 6.8e-16Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 82.4%
*-commutative82.4%
Simplified82.4%
Final simplification82.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.6e+106)
(/ y a)
(if (<= z -960000.0)
(/ (/ x a) (- z))
(if (<= z -3.4e-21)
(* z (/ y (- t)))
(if (<= z -2.25e-108)
(/ x (* z (- a)))
(if (<= z 5.6e+77) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+106) {
tmp = y / a;
} else if (z <= -960000.0) {
tmp = (x / a) / -z;
} else if (z <= -3.4e-21) {
tmp = z * (y / -t);
} else if (z <= -2.25e-108) {
tmp = x / (z * -a);
} else if (z <= 5.6e+77) {
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.6d+106)) then
tmp = y / a
else if (z <= (-960000.0d0)) then
tmp = (x / a) / -z
else if (z <= (-3.4d-21)) then
tmp = z * (y / -t)
else if (z <= (-2.25d-108)) then
tmp = x / (z * -a)
else if (z <= 5.6d+77) 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.6e+106) {
tmp = y / a;
} else if (z <= -960000.0) {
tmp = (x / a) / -z;
} else if (z <= -3.4e-21) {
tmp = z * (y / -t);
} else if (z <= -2.25e-108) {
tmp = x / (z * -a);
} else if (z <= 5.6e+77) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.6e+106: tmp = y / a elif z <= -960000.0: tmp = (x / a) / -z elif z <= -3.4e-21: tmp = z * (y / -t) elif z <= -2.25e-108: tmp = x / (z * -a) elif z <= 5.6e+77: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+106) tmp = Float64(y / a); elseif (z <= -960000.0) tmp = Float64(Float64(x / a) / Float64(-z)); elseif (z <= -3.4e-21) tmp = Float64(z * Float64(y / Float64(-t))); elseif (z <= -2.25e-108) tmp = Float64(x / Float64(z * Float64(-a))); elseif (z <= 5.6e+77) 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.6e+106) tmp = y / a; elseif (z <= -960000.0) tmp = (x / a) / -z; elseif (z <= -3.4e-21) tmp = z * (y / -t); elseif (z <= -2.25e-108) tmp = x / (z * -a); elseif (z <= 5.6e+77) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+106], N[(y / a), $MachinePrecision], If[LessEqual[z, -960000.0], N[(N[(x / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, -3.4e-21], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.25e-108], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -960000:\\
\;\;\;\;\frac{\frac{x}{a}}{-z}\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-21}:\\
\;\;\;\;z \cdot \frac{y}{-t}\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.60000000000000015e106 or 5.60000000000000001e77 < z Initial program 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in z around inf 73.8%
if -6.60000000000000015e106 < z < -9.6e5Initial program 86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in a around inf 77.0%
Taylor expanded in x around inf 59.3%
associate-/r*50.6%
Simplified50.6%
Taylor expanded in t around 0 45.7%
mul-1-neg45.7%
Simplified45.7%
if -9.6e5 < z < -3.4e-21Initial program 99.8%
*-commutative99.8%
Simplified99.8%
clear-num98.4%
associate-/r/99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in x around 0 71.4%
mul-1-neg71.4%
associate-/l*71.4%
distribute-rgt-neg-in71.4%
distribute-neg-frac271.4%
Simplified71.4%
Taylor expanded in y around 0 71.4%
mul-1-neg71.4%
associate-*r/71.4%
*-commutative71.4%
associate-*l/71.4%
associate-*r/71.6%
distribute-rgt-neg-in71.6%
distribute-neg-frac271.6%
Simplified71.6%
if -3.4e-21 < z < -2.24999999999999985e-108Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in t around 0 57.1%
associate-*r/57.1%
neg-mul-157.1%
Simplified57.1%
if -2.24999999999999985e-108 < z < 5.60000000000000001e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.4%
Final simplification63.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.35e+107)
(/ y a)
(if (<= z -750000.0)
(/ (/ x z) (- a))
(if (<= z -6.6e-29)
(* z (/ y (- t)))
(if (<= z -2.5e-108)
(/ x (* z (- a)))
(if (<= z 6e+77) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+107) {
tmp = y / a;
} else if (z <= -750000.0) {
tmp = (x / z) / -a;
} else if (z <= -6.6e-29) {
tmp = z * (y / -t);
} else if (z <= -2.5e-108) {
tmp = x / (z * -a);
} else if (z <= 6e+77) {
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 <= (-1.35d+107)) then
tmp = y / a
else if (z <= (-750000.0d0)) then
tmp = (x / z) / -a
else if (z <= (-6.6d-29)) then
tmp = z * (y / -t)
else if (z <= (-2.5d-108)) then
tmp = x / (z * -a)
else if (z <= 6d+77) 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 <= -1.35e+107) {
tmp = y / a;
} else if (z <= -750000.0) {
tmp = (x / z) / -a;
} else if (z <= -6.6e-29) {
tmp = z * (y / -t);
} else if (z <= -2.5e-108) {
tmp = x / (z * -a);
} else if (z <= 6e+77) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.35e+107: tmp = y / a elif z <= -750000.0: tmp = (x / z) / -a elif z <= -6.6e-29: tmp = z * (y / -t) elif z <= -2.5e-108: tmp = x / (z * -a) elif z <= 6e+77: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e+107) tmp = Float64(y / a); elseif (z <= -750000.0) tmp = Float64(Float64(x / z) / Float64(-a)); elseif (z <= -6.6e-29) tmp = Float64(z * Float64(y / Float64(-t))); elseif (z <= -2.5e-108) tmp = Float64(x / Float64(z * Float64(-a))); elseif (z <= 6e+77) 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 <= -1.35e+107) tmp = y / a; elseif (z <= -750000.0) tmp = (x / z) / -a; elseif (z <= -6.6e-29) tmp = z * (y / -t); elseif (z <= -2.5e-108) tmp = x / (z * -a); elseif (z <= 6e+77) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e+107], N[(y / a), $MachinePrecision], If[LessEqual[z, -750000.0], N[(N[(x / z), $MachinePrecision] / (-a)), $MachinePrecision], If[LessEqual[z, -6.6e-29], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.5e-108], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+107}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -750000:\\
\;\;\;\;\frac{\frac{x}{z}}{-a}\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-29}:\\
\;\;\;\;z \cdot \frac{y}{-t}\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+77}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.3500000000000001e107 or 5.9999999999999996e77 < z Initial program 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in z around inf 73.8%
if -1.3500000000000001e107 < z < -7.5e5Initial program 86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in x around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 40.7%
mul-1-neg40.7%
associate-/l/49.9%
distribute-neg-frac49.9%
distribute-neg-frac249.9%
Simplified49.9%
if -7.5e5 < z < -6.60000000000000055e-29Initial program 99.8%
*-commutative99.8%
Simplified99.8%
clear-num98.4%
associate-/r/99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in x around 0 71.4%
mul-1-neg71.4%
associate-/l*71.4%
distribute-rgt-neg-in71.4%
distribute-neg-frac271.4%
Simplified71.4%
Taylor expanded in y around 0 71.4%
mul-1-neg71.4%
associate-*r/71.4%
*-commutative71.4%
associate-*l/71.4%
associate-*r/71.6%
distribute-rgt-neg-in71.6%
distribute-neg-frac271.6%
Simplified71.6%
if -6.60000000000000055e-29 < z < -2.5e-108Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in t around 0 57.1%
associate-*r/57.1%
neg-mul-157.1%
Simplified57.1%
if -2.5e-108 < z < 5.9999999999999996e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.4%
Final simplification63.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.4e+71) (/ y a) (if (<= z -7e-110) (* y (/ z (- t))) (if (<= z 2.3e+78) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e+71) {
tmp = y / a;
} else if (z <= -7e-110) {
tmp = y * (z / -t);
} else if (z <= 2.3e+78) {
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 <= (-1.4d+71)) then
tmp = y / a
else if (z <= (-7d-110)) then
tmp = y * (z / -t)
else if (z <= 2.3d+78) 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 <= -1.4e+71) {
tmp = y / a;
} else if (z <= -7e-110) {
tmp = y * (z / -t);
} else if (z <= 2.3e+78) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.4e+71: tmp = y / a elif z <= -7e-110: tmp = y * (z / -t) elif z <= 2.3e+78: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.4e+71) tmp = Float64(y / a); elseif (z <= -7e-110) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= 2.3e+78) 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 <= -1.4e+71) tmp = y / a; elseif (z <= -7e-110) tmp = y * (z / -t); elseif (z <= 2.3e+78) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e+71], N[(y / a), $MachinePrecision], If[LessEqual[z, -7e-110], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+78], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+71}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-110}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+78}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.40000000000000001e71 or 2.3000000000000002e78 < z Initial program 61.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in z around inf 70.0%
if -1.40000000000000001e71 < z < -6.99999999999999947e-110Initial program 97.0%
*-commutative97.0%
Simplified97.0%
clear-num96.8%
associate-/r/96.8%
sub-neg96.8%
+-commutative96.8%
*-commutative96.8%
distribute-rgt-neg-in96.8%
fma-define96.8%
Applied egg-rr96.8%
Taylor expanded in a around 0 49.8%
Taylor expanded in x around 0 36.8%
mul-1-neg36.8%
associate-/l*36.9%
distribute-rgt-neg-in36.9%
distribute-neg-frac236.9%
Simplified36.9%
if -6.99999999999999947e-110 < z < 2.3000000000000002e78Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.9%
Final simplification59.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.4e+61)
(/ y a)
(if (<= z -7.2e-110)
(* z (/ y (- t)))
(if (<= z 3.7e+77) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e+61) {
tmp = y / a;
} else if (z <= -7.2e-110) {
tmp = z * (y / -t);
} else if (z <= 3.7e+77) {
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.4d+61)) then
tmp = y / a
else if (z <= (-7.2d-110)) then
tmp = z * (y / -t)
else if (z <= 3.7d+77) 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.4e+61) {
tmp = y / a;
} else if (z <= -7.2e-110) {
tmp = z * (y / -t);
} else if (z <= 3.7e+77) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.4e+61: tmp = y / a elif z <= -7.2e-110: tmp = z * (y / -t) elif z <= 3.7e+77: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e+61) tmp = Float64(y / a); elseif (z <= -7.2e-110) tmp = Float64(z * Float64(y / Float64(-t))); elseif (z <= 3.7e+77) 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.4e+61) tmp = y / a; elseif (z <= -7.2e-110) tmp = z * (y / -t); elseif (z <= 3.7e+77) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e+61], N[(y / a), $MachinePrecision], If[LessEqual[z, -7.2e-110], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+61}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-110}:\\
\;\;\;\;z \cdot \frac{y}{-t}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+77}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.3999999999999999e61 or 3.69999999999999995e77 < z Initial program 63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in z around inf 68.5%
if -2.3999999999999999e61 < z < -7.1999999999999999e-110Initial program 96.7%
*-commutative96.7%
Simplified96.7%
clear-num96.4%
associate-/r/96.6%
sub-neg96.6%
+-commutative96.6%
*-commutative96.6%
distribute-rgt-neg-in96.6%
fma-define96.6%
Applied egg-rr96.6%
Taylor expanded in a around 0 49.7%
Taylor expanded in x around 0 37.9%
mul-1-neg37.9%
associate-/l*37.9%
distribute-rgt-neg-in37.9%
distribute-neg-frac237.9%
Simplified37.9%
Taylor expanded in y around 0 37.9%
mul-1-neg37.9%
associate-*r/37.9%
*-commutative37.9%
associate-*l/37.9%
associate-*r/40.7%
distribute-rgt-neg-in40.7%
distribute-neg-frac240.7%
Simplified40.7%
if -7.1999999999999999e-110 < z < 3.69999999999999995e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.9%
Final simplification60.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.8e+106) (not (<= z 3.6e+77))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.8e+106) || !(z <= 3.6e+77)) {
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 <= (-6.8d+106)) .or. (.not. (z <= 3.6d+77))) 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 <= -6.8e+106) || !(z <= 3.6e+77)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.8e+106) or not (z <= 3.6e+77): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.8e+106) || !(z <= 3.6e+77)) 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 <= -6.8e+106) || ~((z <= 3.6e+77))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.8e+106], N[Not[LessEqual[z, 3.6e+77]], $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 -6.8 \cdot 10^{+106} \lor \neg \left(z \leq 3.6 \cdot 10^{+77}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -6.79999999999999989e106 or 3.5999999999999998e77 < z Initial program 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in z around inf 73.8%
if -6.79999999999999989e106 < z < 3.5999999999999998e77Initial program 98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in x around inf 71.9%
*-commutative71.9%
Simplified71.9%
Final simplification72.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.2e+36) (not (<= z 2.3e+78))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.2e+36) || !(z <= 2.3e+78)) {
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.2d+36)) .or. (.not. (z <= 2.3d+78))) 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.2e+36) || !(z <= 2.3e+78)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.2e+36) or not (z <= 2.3e+78): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.2e+36) || !(z <= 2.3e+78)) 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.2e+36) || ~((z <= 2.3e+78))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.2e+36], N[Not[LessEqual[z, 2.3e+78]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+36} \lor \neg \left(z \leq 2.3 \cdot 10^{+78}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -4.20000000000000009e36 or 2.3000000000000002e78 < z Initial program 64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in z around inf 65.9%
if -4.20000000000000009e36 < z < 2.3000000000000002e78Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 50.8%
Final simplification57.7%
(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 83.6%
*-commutative83.6%
Simplified83.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 2024080
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(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))))