
(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
(let* ((t_1 (- t (* z a)))
(t_2 (* y (+ (/ z (- (* z a) t)) (/ x (* y t_1)))))
(t_3 (/ (- x (* y z)) t_1)))
(if (<= t_3 (- INFINITY))
t_2
(if (<= t_3 -5e-311)
t_3
(if (<= t_3 0.0)
(* (/ x a) (/ 1.0 (- (/ t a) z)))
(if (<= t_3 2e+292) t_3 (if (<= t_3 INFINITY) t_2 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_3 <= -5e-311) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (x / a) * (1.0 / ((t / a) - z));
} else if (t_3 <= 2e+292) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_3 <= -5e-311) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (x / a) * (1.0 / ((t / a) - z));
} else if (t_3 <= 2e+292) {
tmp = t_3;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = y * ((z / ((z * a) - t)) + (x / (y * t_1))) t_3 = (x - (y * z)) / t_1 tmp = 0 if t_3 <= -math.inf: tmp = t_2 elif t_3 <= -5e-311: tmp = t_3 elif t_3 <= 0.0: tmp = (x / a) * (1.0 / ((t / a) - z)) elif t_3 <= 2e+292: tmp = t_3 elif t_3 <= math.inf: tmp = t_2 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(y * Float64(Float64(z / Float64(Float64(z * a) - t)) + Float64(x / Float64(y * t_1)))) t_3 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_2; elseif (t_3 <= -5e-311) tmp = t_3; elseif (t_3 <= 0.0) tmp = Float64(Float64(x / a) * Float64(1.0 / Float64(Float64(t / a) - z))); elseif (t_3 <= 2e+292) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = y * ((z / ((z * a) - t)) + (x / (y * t_1))); t_3 = (x - (y * z)) / t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = t_2; elseif (t_3 <= -5e-311) tmp = t_3; elseif (t_3 <= 0.0) tmp = (x / a) * (1.0 / ((t / a) - z)); elseif (t_3 <= 2e+292) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(x / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$2, If[LessEqual[t$95$3, -5e-311], t$95$3, If[LessEqual[t$95$3, 0.0], N[(N[(x / a), $MachinePrecision] * N[(1.0 / N[(N[(t / a), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+292], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\
t_3 := \frac{x - y \cdot z}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-311}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{x}{a} \cdot \frac{1}{\frac{t}{a} - z}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+292}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0 or 2e292 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 52.0%
*-commutative52.0%
Simplified52.0%
Taylor expanded in y around inf 99.7%
mul-1-neg99.7%
distribute-neg-frac299.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
*-commutative99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
neg-sub099.7%
fma-undefine99.7%
distribute-rgt-neg-in99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
associate--r+99.7%
neg-sub099.7%
distribute-rgt-neg-out99.7%
remove-double-neg99.7%
Simplified99.7%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5.00000000000023e-311 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 2e292Initial program 99.7%
if -5.00000000000023e-311 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 61.5%
*-commutative61.5%
Simplified61.5%
Taylor expanded in a around inf 61.5%
Taylor expanded in x around inf 61.5%
associate-/r*88.7%
div-inv88.8%
Applied egg-rr88.8%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (* z (- a)))))
(if (<= z -7.5e+116)
(/ y a)
(if (<= z -2.4e+19)
(* z (/ (- y) t))
(if (<= z -2.35e-26)
t_1
(if (<= z -1.36e-52)
(* y (/ z (- t)))
(if (<= z -1.26e-141)
(/ y a)
(if (<= z 1.2e-94)
(/ x t)
(if (<= z 2.25e-72)
t_1
(if (<= z 1.7e+35) (/ 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 <= -7.5e+116) {
tmp = y / a;
} else if (z <= -2.4e+19) {
tmp = z * (-y / t);
} else if (z <= -2.35e-26) {
tmp = t_1;
} else if (z <= -1.36e-52) {
tmp = y * (z / -t);
} else if (z <= -1.26e-141) {
tmp = y / a;
} else if (z <= 1.2e-94) {
tmp = x / t;
} else if (z <= 2.25e-72) {
tmp = t_1;
} else if (z <= 1.7e+35) {
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 <= (-7.5d+116)) then
tmp = y / a
else if (z <= (-2.4d+19)) then
tmp = z * (-y / t)
else if (z <= (-2.35d-26)) then
tmp = t_1
else if (z <= (-1.36d-52)) then
tmp = y * (z / -t)
else if (z <= (-1.26d-141)) then
tmp = y / a
else if (z <= 1.2d-94) then
tmp = x / t
else if (z <= 2.25d-72) then
tmp = t_1
else if (z <= 1.7d+35) 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 <= -7.5e+116) {
tmp = y / a;
} else if (z <= -2.4e+19) {
tmp = z * (-y / t);
} else if (z <= -2.35e-26) {
tmp = t_1;
} else if (z <= -1.36e-52) {
tmp = y * (z / -t);
} else if (z <= -1.26e-141) {
tmp = y / a;
} else if (z <= 1.2e-94) {
tmp = x / t;
} else if (z <= 2.25e-72) {
tmp = t_1;
} else if (z <= 1.7e+35) {
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 <= -7.5e+116: tmp = y / a elif z <= -2.4e+19: tmp = z * (-y / t) elif z <= -2.35e-26: tmp = t_1 elif z <= -1.36e-52: tmp = y * (z / -t) elif z <= -1.26e-141: tmp = y / a elif z <= 1.2e-94: tmp = x / t elif z <= 2.25e-72: tmp = t_1 elif z <= 1.7e+35: 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 <= -7.5e+116) tmp = Float64(y / a); elseif (z <= -2.4e+19) tmp = Float64(z * Float64(Float64(-y) / t)); elseif (z <= -2.35e-26) tmp = t_1; elseif (z <= -1.36e-52) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= -1.26e-141) tmp = Float64(y / a); elseif (z <= 1.2e-94) tmp = Float64(x / t); elseif (z <= 2.25e-72) tmp = t_1; elseif (z <= 1.7e+35) 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 <= -7.5e+116) tmp = y / a; elseif (z <= -2.4e+19) tmp = z * (-y / t); elseif (z <= -2.35e-26) tmp = t_1; elseif (z <= -1.36e-52) tmp = y * (z / -t); elseif (z <= -1.26e-141) tmp = y / a; elseif (z <= 1.2e-94) tmp = x / t; elseif (z <= 2.25e-72) tmp = t_1; elseif (z <= 1.7e+35) 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, -7.5e+116], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.4e+19], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.35e-26], t$95$1, If[LessEqual[z, -1.36e-52], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.26e-141], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.2e-94], N[(x / t), $MachinePrecision], If[LessEqual[z, 2.25e-72], t$95$1, If[LessEqual[z, 1.7e+35], 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 -7.5 \cdot 10^{+116}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{+19}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.36 \cdot 10^{-52}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq -1.26 \cdot 10^{-141}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-94}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -7.5e116 or -1.36e-52 < z < -1.26e-141 or 1.7000000000000001e35 < z Initial program 60.8%
*-commutative60.8%
Simplified60.8%
Taylor expanded in z around inf 56.3%
if -7.5e116 < z < -2.4e19Initial program 88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in y around inf 76.1%
mul-1-neg76.1%
distribute-neg-frac276.1%
cancel-sign-sub-inv76.1%
*-commutative76.1%
+-commutative76.1%
*-commutative76.1%
distribute-lft-neg-in76.1%
distribute-rgt-neg-in76.1%
fma-undefine76.1%
neg-sub076.1%
fma-undefine76.1%
distribute-rgt-neg-in76.1%
distribute-lft-neg-in76.1%
*-commutative76.1%
associate--r+76.1%
neg-sub076.1%
distribute-rgt-neg-out76.1%
remove-double-neg76.1%
Simplified76.1%
Taylor expanded in t around inf 62.9%
Taylor expanded in z around inf 62.8%
+-commutative62.8%
mul-1-neg62.8%
unsub-neg62.8%
Simplified62.8%
Taylor expanded in x around 0 52.5%
associate-*r/52.5%
mul-1-neg52.5%
Simplified52.5%
if -2.4e19 < z < -2.34999999999999995e-26 or 1.2e-94 < z < 2.25e-72Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 68.5%
associate-*r/68.5%
neg-mul-168.5%
neg-sub068.5%
sub-neg68.5%
distribute-rgt-neg-out68.5%
+-commutative68.5%
associate--r+68.5%
neg-sub068.5%
distribute-rgt-neg-out68.5%
remove-double-neg68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in y around 0 55.2%
neg-mul-155.2%
Simplified55.2%
if -2.34999999999999995e-26 < z < -1.36e-52Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 81.0%
mul-1-neg81.0%
associate-/l*80.7%
distribute-rgt-neg-in80.7%
distribute-neg-frac280.7%
cancel-sign-sub-inv80.7%
*-commutative80.7%
+-commutative80.7%
*-commutative80.7%
distribute-lft-neg-in80.7%
distribute-rgt-neg-in80.7%
fma-undefine80.7%
neg-sub080.7%
fma-undefine80.7%
distribute-rgt-neg-in80.7%
distribute-lft-neg-in80.7%
*-commutative80.7%
associate--r+80.7%
neg-sub080.7%
distribute-rgt-neg-out80.7%
remove-double-neg80.7%
Simplified80.7%
Taylor expanded in z around 0 61.2%
associate-*r/61.2%
mul-1-neg61.2%
Simplified61.2%
if -1.26e-141 < z < 1.2e-94 or 2.25e-72 < z < 1.7000000000000001e35Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 66.8%
Final simplification60.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (* z (- a)))) (t_2 (/ (* y z) (- t))))
(if (<= z -8.5e+116)
(/ y a)
(if (<= z -2.55e+19)
t_2
(if (<= z -2.4e-26)
t_1
(if (<= z -5.1e-52)
t_2
(if (<= z -2.5e-141)
(/ y a)
(if (<= z 7e-95)
(/ x t)
(if (<= z 2.1e-74)
t_1
(if (<= z 1.9e+35) (/ x t) (/ y a)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (z * -a);
double t_2 = (y * z) / -t;
double tmp;
if (z <= -8.5e+116) {
tmp = y / a;
} else if (z <= -2.55e+19) {
tmp = t_2;
} else if (z <= -2.4e-26) {
tmp = t_1;
} else if (z <= -5.1e-52) {
tmp = t_2;
} else if (z <= -2.5e-141) {
tmp = y / a;
} else if (z <= 7e-95) {
tmp = x / t;
} else if (z <= 2.1e-74) {
tmp = t_1;
} else if (z <= 1.9e+35) {
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) :: t_2
real(8) :: tmp
t_1 = x / (z * -a)
t_2 = (y * z) / -t
if (z <= (-8.5d+116)) then
tmp = y / a
else if (z <= (-2.55d+19)) then
tmp = t_2
else if (z <= (-2.4d-26)) then
tmp = t_1
else if (z <= (-5.1d-52)) then
tmp = t_2
else if (z <= (-2.5d-141)) then
tmp = y / a
else if (z <= 7d-95) then
tmp = x / t
else if (z <= 2.1d-74) then
tmp = t_1
else if (z <= 1.9d+35) 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 t_2 = (y * z) / -t;
double tmp;
if (z <= -8.5e+116) {
tmp = y / a;
} else if (z <= -2.55e+19) {
tmp = t_2;
} else if (z <= -2.4e-26) {
tmp = t_1;
} else if (z <= -5.1e-52) {
tmp = t_2;
} else if (z <= -2.5e-141) {
tmp = y / a;
} else if (z <= 7e-95) {
tmp = x / t;
} else if (z <= 2.1e-74) {
tmp = t_1;
} else if (z <= 1.9e+35) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (z * -a) t_2 = (y * z) / -t tmp = 0 if z <= -8.5e+116: tmp = y / a elif z <= -2.55e+19: tmp = t_2 elif z <= -2.4e-26: tmp = t_1 elif z <= -5.1e-52: tmp = t_2 elif z <= -2.5e-141: tmp = y / a elif z <= 7e-95: tmp = x / t elif z <= 2.1e-74: tmp = t_1 elif z <= 1.9e+35: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(z * Float64(-a))) t_2 = Float64(Float64(y * z) / Float64(-t)) tmp = 0.0 if (z <= -8.5e+116) tmp = Float64(y / a); elseif (z <= -2.55e+19) tmp = t_2; elseif (z <= -2.4e-26) tmp = t_1; elseif (z <= -5.1e-52) tmp = t_2; elseif (z <= -2.5e-141) tmp = Float64(y / a); elseif (z <= 7e-95) tmp = Float64(x / t); elseif (z <= 2.1e-74) tmp = t_1; elseif (z <= 1.9e+35) 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); t_2 = (y * z) / -t; tmp = 0.0; if (z <= -8.5e+116) tmp = y / a; elseif (z <= -2.55e+19) tmp = t_2; elseif (z <= -2.4e-26) tmp = t_1; elseif (z <= -5.1e-52) tmp = t_2; elseif (z <= -2.5e-141) tmp = y / a; elseif (z <= 7e-95) tmp = x / t; elseif (z <= 2.1e-74) tmp = t_1; elseif (z <= 1.9e+35) 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]}, Block[{t$95$2 = N[(N[(y * z), $MachinePrecision] / (-t)), $MachinePrecision]}, If[LessEqual[z, -8.5e+116], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.55e+19], t$95$2, If[LessEqual[z, -2.4e-26], t$95$1, If[LessEqual[z, -5.1e-52], t$95$2, If[LessEqual[z, -2.5e-141], N[(y / a), $MachinePrecision], If[LessEqual[z, 7e-95], N[(x / t), $MachinePrecision], If[LessEqual[z, 2.1e-74], t$95$1, If[LessEqual[z, 1.9e+35], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(-a\right)}\\
t_2 := \frac{y \cdot z}{-t}\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+116}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2.55 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-52}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-141}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-95}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -8.5000000000000002e116 or -5.09999999999999989e-52 < z < -2.5e-141 or 1.9e35 < z Initial program 60.8%
*-commutative60.8%
Simplified60.8%
Taylor expanded in z around inf 56.3%
if -8.5000000000000002e116 < z < -2.55e19 or -2.4000000000000001e-26 < z < -5.09999999999999989e-52Initial program 91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in x around 0 64.9%
mul-1-neg64.9%
associate-/l*69.2%
distribute-rgt-neg-in69.2%
distribute-neg-frac269.2%
cancel-sign-sub-inv69.2%
*-commutative69.2%
+-commutative69.2%
*-commutative69.2%
distribute-lft-neg-in69.2%
distribute-rgt-neg-in69.2%
fma-undefine69.2%
neg-sub069.2%
fma-undefine69.2%
distribute-rgt-neg-in69.2%
distribute-lft-neg-in69.2%
*-commutative69.2%
associate--r+69.2%
neg-sub069.2%
distribute-rgt-neg-out69.2%
remove-double-neg69.2%
Simplified69.2%
Taylor expanded in z around 0 54.6%
associate-*r/54.6%
associate-*r*54.6%
mul-1-neg54.6%
Simplified54.6%
if -2.55e19 < z < -2.4000000000000001e-26 or 6.9999999999999994e-95 < z < 2.1e-74Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 68.5%
associate-*r/68.5%
neg-mul-168.5%
neg-sub068.5%
sub-neg68.5%
distribute-rgt-neg-out68.5%
+-commutative68.5%
associate--r+68.5%
neg-sub068.5%
distribute-rgt-neg-out68.5%
remove-double-neg68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in y around 0 55.2%
neg-mul-155.2%
Simplified55.2%
if -2.5e-141 < z < 6.9999999999999994e-95 or 2.1e-74 < z < 1.9e35Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 66.8%
Final simplification60.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))) (t_2 (/ (- x (* y z)) t)))
(if (<= z -8.6e+116)
(/ y a)
(if (<= z -6.2e+19)
t_2
(if (<= z -2.3e-26)
t_1
(if (<= z 7.5e-90) t_2 (if (<= z 3.5e+54) t_1 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double t_2 = (x - (y * z)) / t;
double tmp;
if (z <= -8.6e+116) {
tmp = y / a;
} else if (z <= -6.2e+19) {
tmp = t_2;
} else if (z <= -2.3e-26) {
tmp = t_1;
} else if (z <= 7.5e-90) {
tmp = t_2;
} else if (z <= 3.5e+54) {
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 / (t - (z * a))
t_2 = (x - (y * z)) / t
if (z <= (-8.6d+116)) then
tmp = y / a
else if (z <= (-6.2d+19)) then
tmp = t_2
else if (z <= (-2.3d-26)) then
tmp = t_1
else if (z <= 7.5d-90) then
tmp = t_2
else if (z <= 3.5d+54) 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 t_2 = (x - (y * z)) / t;
double tmp;
if (z <= -8.6e+116) {
tmp = y / a;
} else if (z <= -6.2e+19) {
tmp = t_2;
} else if (z <= -2.3e-26) {
tmp = t_1;
} else if (z <= 7.5e-90) {
tmp = t_2;
} else if (z <= 3.5e+54) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) t_2 = (x - (y * z)) / t tmp = 0 if z <= -8.6e+116: tmp = y / a elif z <= -6.2e+19: tmp = t_2 elif z <= -2.3e-26: tmp = t_1 elif z <= 7.5e-90: tmp = t_2 elif z <= 3.5e+54: 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))) t_2 = Float64(Float64(x - Float64(y * z)) / t) tmp = 0.0 if (z <= -8.6e+116) tmp = Float64(y / a); elseif (z <= -6.2e+19) tmp = t_2; elseif (z <= -2.3e-26) tmp = t_1; elseif (z <= 7.5e-90) tmp = t_2; elseif (z <= 3.5e+54) 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)); t_2 = (x - (y * z)) / t; tmp = 0.0; if (z <= -8.6e+116) tmp = y / a; elseif (z <= -6.2e+19) tmp = t_2; elseif (z <= -2.3e-26) tmp = t_1; elseif (z <= 7.5e-90) tmp = t_2; elseif (z <= 3.5e+54) 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]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -8.6e+116], N[(y / a), $MachinePrecision], If[LessEqual[z, -6.2e+19], t$95$2, If[LessEqual[z, -2.3e-26], t$95$1, If[LessEqual[z, 7.5e-90], t$95$2, If[LessEqual[z, 3.5e+54], t$95$1, N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
t_2 := \frac{x - y \cdot z}{t}\\
\mathbf{if}\;z \leq -8.6 \cdot 10^{+116}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -8.6e116 or 3.5000000000000001e54 < z Initial program 51.6%
*-commutative51.6%
Simplified51.6%
Taylor expanded in z around inf 60.0%
if -8.6e116 < z < -6.2e19 or -2.30000000000000009e-26 < z < 7.4999999999999999e-90Initial program 98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in t around inf 77.8%
if -6.2e19 < z < -2.30000000000000009e-26 or 7.4999999999999999e-90 < z < 3.5000000000000001e54Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 75.9%
*-commutative75.9%
Simplified75.9%
Final simplification71.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))) (t_2 (* y (/ z (- (* z a) t)))))
(if (<= z -2.55e+19)
t_2
(if (<= z -2.35e-26)
t_1
(if (<= z 1.08e-91) (/ (- x (* y z)) t) (if (<= z 1.5e+53) 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 * (z / ((z * a) - t));
double tmp;
if (z <= -2.55e+19) {
tmp = t_2;
} else if (z <= -2.35e-26) {
tmp = t_1;
} else if (z <= 1.08e-91) {
tmp = (x - (y * z)) / t;
} else if (z <= 1.5e+53) {
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 * (z / ((z * a) - t))
if (z <= (-2.55d+19)) then
tmp = t_2
else if (z <= (-2.35d-26)) then
tmp = t_1
else if (z <= 1.08d-91) then
tmp = (x - (y * z)) / t
else if (z <= 1.5d+53) 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 * (z / ((z * a) - t));
double tmp;
if (z <= -2.55e+19) {
tmp = t_2;
} else if (z <= -2.35e-26) {
tmp = t_1;
} else if (z <= 1.08e-91) {
tmp = (x - (y * z)) / t;
} else if (z <= 1.5e+53) {
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 * (z / ((z * a) - t)) tmp = 0 if z <= -2.55e+19: tmp = t_2 elif z <= -2.35e-26: tmp = t_1 elif z <= 1.08e-91: tmp = (x - (y * z)) / t elif z <= 1.5e+53: 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(y * Float64(z / Float64(Float64(z * a) - t))) tmp = 0.0 if (z <= -2.55e+19) tmp = t_2; elseif (z <= -2.35e-26) tmp = t_1; elseif (z <= 1.08e-91) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 1.5e+53) 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 * (z / ((z * a) - t)); tmp = 0.0; if (z <= -2.55e+19) tmp = t_2; elseif (z <= -2.35e-26) tmp = t_1; elseif (z <= 1.08e-91) tmp = (x - (y * z)) / t; elseif (z <= 1.5e+53) 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[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.55e+19], t$95$2, If[LessEqual[z, -2.35e-26], t$95$1, If[LessEqual[z, 1.08e-91], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.5e+53], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
t_2 := y \cdot \frac{z}{z \cdot a - t}\\
\mathbf{if}\;z \leq -2.55 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-91}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.55e19 or 1.49999999999999999e53 < z Initial program 57.0%
*-commutative57.0%
Simplified57.0%
Taylor expanded in x around 0 46.1%
mul-1-neg46.1%
associate-/l*65.2%
distribute-rgt-neg-in65.2%
distribute-neg-frac265.2%
cancel-sign-sub-inv65.2%
*-commutative65.2%
+-commutative65.2%
*-commutative65.2%
distribute-lft-neg-in65.2%
distribute-rgt-neg-in65.2%
fma-undefine65.2%
neg-sub065.2%
fma-undefine65.2%
distribute-rgt-neg-in65.2%
distribute-lft-neg-in65.2%
*-commutative65.2%
associate--r+65.2%
neg-sub065.2%
distribute-rgt-neg-out65.2%
remove-double-neg65.2%
Simplified65.2%
if -2.55e19 < z < -2.34999999999999995e-26 or 1.07999999999999998e-91 < z < 1.49999999999999999e53Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 75.9%
*-commutative75.9%
Simplified75.9%
if -2.34999999999999995e-26 < z < 1.07999999999999998e-91Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 80.2%
Final simplification73.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= z -4e+18)
(* y (/ z (- (* z a) t)))
(if (<= z -2.05e-26)
t_1
(if (<= z 5.1e-90)
(/ (- x (* y z)) t)
(if (<= z 1.7e+35) t_1 (- (/ y a) (/ (/ x z) a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -4e+18) {
tmp = y * (z / ((z * a) - t));
} else if (z <= -2.05e-26) {
tmp = t_1;
} else if (z <= 5.1e-90) {
tmp = (x - (y * z)) / t;
} else if (z <= 1.7e+35) {
tmp = t_1;
} else {
tmp = (y / a) - ((x / 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) :: t_1
real(8) :: tmp
t_1 = x / (t - (z * a))
if (z <= (-4d+18)) then
tmp = y * (z / ((z * a) - t))
else if (z <= (-2.05d-26)) then
tmp = t_1
else if (z <= 5.1d-90) then
tmp = (x - (y * z)) / t
else if (z <= 1.7d+35) then
tmp = t_1
else
tmp = (y / a) - ((x / z) / 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 <= -4e+18) {
tmp = y * (z / ((z * a) - t));
} else if (z <= -2.05e-26) {
tmp = t_1;
} else if (z <= 5.1e-90) {
tmp = (x - (y * z)) / t;
} else if (z <= 1.7e+35) {
tmp = t_1;
} else {
tmp = (y / a) - ((x / z) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if z <= -4e+18: tmp = y * (z / ((z * a) - t)) elif z <= -2.05e-26: tmp = t_1 elif z <= 5.1e-90: tmp = (x - (y * z)) / t elif z <= 1.7e+35: tmp = t_1 else: tmp = (y / a) - ((x / z) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (z <= -4e+18) tmp = Float64(y * Float64(z / Float64(Float64(z * a) - t))); elseif (z <= -2.05e-26) tmp = t_1; elseif (z <= 5.1e-90) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 1.7e+35) tmp = t_1; else tmp = Float64(Float64(y / a) - Float64(Float64(x / z) / 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 <= -4e+18) tmp = y * (z / ((z * a) - t)); elseif (z <= -2.05e-26) tmp = t_1; elseif (z <= 5.1e-90) tmp = (x - (y * z)) / t; elseif (z <= 1.7e+35) tmp = t_1; else tmp = (y / a) - ((x / z) / 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, -4e+18], N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.05e-26], t$95$1, If[LessEqual[z, 5.1e-90], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.7e+35], t$95$1, N[(N[(y / a), $MachinePrecision] - N[(N[(x / z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;z \leq -4 \cdot 10^{+18}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot a - t}\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-90}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -4e18Initial program 63.8%
*-commutative63.8%
Simplified63.8%
Taylor expanded in x around 0 50.2%
mul-1-neg50.2%
associate-/l*72.1%
distribute-rgt-neg-in72.1%
distribute-neg-frac272.1%
cancel-sign-sub-inv72.1%
*-commutative72.1%
+-commutative72.1%
*-commutative72.1%
distribute-lft-neg-in72.1%
distribute-rgt-neg-in72.1%
fma-undefine72.1%
neg-sub072.1%
fma-undefine72.1%
distribute-rgt-neg-in72.1%
distribute-lft-neg-in72.1%
*-commutative72.1%
associate--r+72.1%
neg-sub072.1%
distribute-rgt-neg-out72.1%
remove-double-neg72.1%
Simplified72.1%
if -4e18 < z < -2.0499999999999999e-26 or 5.0999999999999997e-90 < z < 1.7000000000000001e35Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 75.4%
*-commutative75.4%
Simplified75.4%
if -2.0499999999999999e-26 < z < 5.0999999999999997e-90Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 80.2%
if 1.7000000000000001e35 < z Initial program 54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in t around 0 41.5%
associate-*r/41.5%
neg-mul-141.5%
neg-sub041.5%
sub-neg41.5%
distribute-rgt-neg-out41.5%
+-commutative41.5%
associate--r+41.5%
neg-sub041.5%
distribute-rgt-neg-out41.5%
remove-double-neg41.5%
*-commutative41.5%
Simplified41.5%
Taylor expanded in y around 0 66.4%
+-commutative66.4%
mul-1-neg66.4%
unsub-neg66.4%
*-commutative66.4%
associate-/r*82.3%
Simplified82.3%
Final simplification78.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.3e+184)
(* y (/ z (- (* z a) t)))
(if (<= z 1.1e+124)
(/ (- x (* y z)) (- t (* z a)))
(- (/ y a) (/ (/ x z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+184) {
tmp = y * (z / ((z * a) - t));
} else if (z <= 1.1e+124) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = (y / a) - ((x / 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.3d+184)) then
tmp = y * (z / ((z * a) - t))
else if (z <= 1.1d+124) then
tmp = (x - (y * z)) / (t - (z * a))
else
tmp = (y / a) - ((x / 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.3e+184) {
tmp = y * (z / ((z * a) - t));
} else if (z <= 1.1e+124) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = (y / a) - ((x / z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.3e+184: tmp = y * (z / ((z * a) - t)) elif z <= 1.1e+124: tmp = (x - (y * z)) / (t - (z * a)) else: tmp = (y / a) - ((x / z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e+184) tmp = Float64(y * Float64(z / Float64(Float64(z * a) - t))); elseif (z <= 1.1e+124) tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); else tmp = Float64(Float64(y / a) - Float64(Float64(x / z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.3e+184) tmp = y * (z / ((z * a) - t)); elseif (z <= 1.1e+124) tmp = (x - (y * z)) / (t - (z * a)); else tmp = (y / a) - ((x / z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e+184], N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+124], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] - N[(N[(x / z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+184}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot a - t}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+124}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -2.3e184Initial program 47.1%
*-commutative47.1%
Simplified47.1%
Taylor expanded in x around 0 43.2%
mul-1-neg43.2%
associate-/l*80.3%
distribute-rgt-neg-in80.3%
distribute-neg-frac280.3%
cancel-sign-sub-inv80.3%
*-commutative80.3%
+-commutative80.3%
*-commutative80.3%
distribute-lft-neg-in80.3%
distribute-rgt-neg-in80.3%
fma-undefine80.3%
neg-sub080.3%
fma-undefine80.3%
distribute-rgt-neg-in80.3%
distribute-lft-neg-in80.3%
*-commutative80.3%
associate--r+80.3%
neg-sub080.3%
distribute-rgt-neg-out80.3%
remove-double-neg80.3%
Simplified80.3%
if -2.3e184 < z < 1.1e124Initial program 94.3%
if 1.1e124 < z Initial program 46.3%
*-commutative46.3%
Simplified46.3%
Taylor expanded in t around 0 37.1%
associate-*r/37.1%
neg-mul-137.1%
neg-sub037.1%
sub-neg37.1%
distribute-rgt-neg-out37.1%
+-commutative37.1%
associate--r+37.1%
neg-sub037.1%
distribute-rgt-neg-out37.1%
remove-double-neg37.1%
*-commutative37.1%
Simplified37.1%
Taylor expanded in y around 0 68.9%
+-commutative68.9%
mul-1-neg68.9%
unsub-neg68.9%
*-commutative68.9%
associate-/r*86.3%
Simplified86.3%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.5e+116) (/ y a) (if (<= z -8.5e+18) (* y (/ z (- t))) (if (<= z 1.2e+36) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e+116) {
tmp = y / a;
} else if (z <= -8.5e+18) {
tmp = y * (z / -t);
} else if (z <= 1.2e+36) {
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 <= (-7.5d+116)) then
tmp = y / a
else if (z <= (-8.5d+18)) then
tmp = y * (z / -t)
else if (z <= 1.2d+36) 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 <= -7.5e+116) {
tmp = y / a;
} else if (z <= -8.5e+18) {
tmp = y * (z / -t);
} else if (z <= 1.2e+36) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e+116: tmp = y / a elif z <= -8.5e+18: tmp = y * (z / -t) elif z <= 1.2e+36: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e+116) tmp = Float64(y / a); elseif (z <= -8.5e+18) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= 1.2e+36) 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 <= -7.5e+116) tmp = y / a; elseif (z <= -8.5e+18) tmp = y * (z / -t); elseif (z <= 1.2e+36) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e+116], N[(y / a), $MachinePrecision], If[LessEqual[z, -8.5e+18], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+36], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+116}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{+18}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+36}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -7.5e116 or 1.19999999999999996e36 < z Initial program 54.1%
*-commutative54.1%
Simplified54.1%
Taylor expanded in z around inf 59.1%
if -7.5e116 < z < -8.5e18Initial program 88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in x around 0 59.9%
mul-1-neg59.9%
associate-/l*65.7%
distribute-rgt-neg-in65.7%
distribute-neg-frac265.7%
cancel-sign-sub-inv65.7%
*-commutative65.7%
+-commutative65.7%
*-commutative65.7%
distribute-lft-neg-in65.7%
distribute-rgt-neg-in65.7%
fma-undefine65.7%
neg-sub065.7%
fma-undefine65.7%
distribute-rgt-neg-in65.7%
distribute-lft-neg-in65.7%
*-commutative65.7%
associate--r+65.7%
neg-sub065.7%
distribute-rgt-neg-out65.7%
remove-double-neg65.7%
Simplified65.7%
Taylor expanded in z around 0 52.5%
associate-*r/52.5%
mul-1-neg52.5%
Simplified52.5%
if -8.5e18 < z < 1.19999999999999996e36Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 54.8%
Final simplification56.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.5e+116) (/ y a) (if (<= z -7.8e+18) (* z (/ (- y) t)) (if (<= z 1.9e+35) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+116) {
tmp = y / a;
} else if (z <= -7.8e+18) {
tmp = z * (-y / t);
} else if (z <= 1.9e+35) {
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 <= (-8.5d+116)) then
tmp = y / a
else if (z <= (-7.8d+18)) then
tmp = z * (-y / t)
else if (z <= 1.9d+35) 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 <= -8.5e+116) {
tmp = y / a;
} else if (z <= -7.8e+18) {
tmp = z * (-y / t);
} else if (z <= 1.9e+35) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e+116: tmp = y / a elif z <= -7.8e+18: tmp = z * (-y / t) elif z <= 1.9e+35: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+116) tmp = Float64(y / a); elseif (z <= -7.8e+18) tmp = Float64(z * Float64(Float64(-y) / t)); elseif (z <= 1.9e+35) 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 <= -8.5e+116) tmp = y / a; elseif (z <= -7.8e+18) tmp = z * (-y / t); elseif (z <= 1.9e+35) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+116], N[(y / a), $MachinePrecision], If[LessEqual[z, -7.8e+18], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+35], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+116}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{+18}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -8.5000000000000002e116 or 1.9e35 < z Initial program 54.1%
*-commutative54.1%
Simplified54.1%
Taylor expanded in z around inf 59.1%
if -8.5000000000000002e116 < z < -7.8e18Initial program 88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in y around inf 76.1%
mul-1-neg76.1%
distribute-neg-frac276.1%
cancel-sign-sub-inv76.1%
*-commutative76.1%
+-commutative76.1%
*-commutative76.1%
distribute-lft-neg-in76.1%
distribute-rgt-neg-in76.1%
fma-undefine76.1%
neg-sub076.1%
fma-undefine76.1%
distribute-rgt-neg-in76.1%
distribute-lft-neg-in76.1%
*-commutative76.1%
associate--r+76.1%
neg-sub076.1%
distribute-rgt-neg-out76.1%
remove-double-neg76.1%
Simplified76.1%
Taylor expanded in t around inf 62.9%
Taylor expanded in z around inf 62.8%
+-commutative62.8%
mul-1-neg62.8%
unsub-neg62.8%
Simplified62.8%
Taylor expanded in x around 0 52.5%
associate-*r/52.5%
mul-1-neg52.5%
Simplified52.5%
if -7.8e18 < z < 1.9e35Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 54.8%
Final simplification56.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e+116) (not (<= z 1.3e+54))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e+116) || !(z <= 1.3e+54)) {
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 <= (-9d+116)) .or. (.not. (z <= 1.3d+54))) 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 <= -9e+116) || !(z <= 1.3e+54)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e+116) or not (z <= 1.3e+54): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e+116) || !(z <= 1.3e+54)) 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 <= -9e+116) || ~((z <= 1.3e+54))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e+116], N[Not[LessEqual[z, 1.3e+54]], $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 -9 \cdot 10^{+116} \lor \neg \left(z \leq 1.3 \cdot 10^{+54}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -9.00000000000000032e116 or 1.30000000000000003e54 < z Initial program 51.6%
*-commutative51.6%
Simplified51.6%
Taylor expanded in z around inf 60.0%
if -9.00000000000000032e116 < z < 1.30000000000000003e54Initial program 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in x around inf 66.9%
*-commutative66.9%
Simplified66.9%
Final simplification64.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5000000000000.0) (not (<= z 1.9e+35))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5000000000000.0) || !(z <= 1.9e+35)) {
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 <= (-5000000000000.0d0)) .or. (.not. (z <= 1.9d+35))) 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 <= -5000000000000.0) || !(z <= 1.9e+35)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5000000000000.0) or not (z <= 1.9e+35): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5000000000000.0) || !(z <= 1.9e+35)) 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 <= -5000000000000.0) || ~((z <= 1.9e+35))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5000000000000.0], N[Not[LessEqual[z, 1.9e+35]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5000000000000 \lor \neg \left(z \leq 1.9 \cdot 10^{+35}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -5e12 or 1.9e35 < z Initial program 59.6%
*-commutative59.6%
Simplified59.6%
Taylor expanded in z around inf 53.1%
if -5e12 < z < 1.9e35Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 55.5%
Final simplification54.4%
(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 81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in z around 0 34.1%
Final simplification34.1%
(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 2024055
(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))))