
(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 11 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 (/ (- x (* y z)) t_1)))
(if (<= t_2 (- INFINITY))
(/ y (/ t_1 (- z)))
(if (or (<= t_2 -2e-311) (and (not (<= t_2 0.0)) (<= t_2 5e+293)))
t_2
(- (/ y a) (/ (/ x a) z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = y / (t_1 / -z);
} else if ((t_2 <= -2e-311) || (!(t_2 <= 0.0) && (t_2 <= 5e+293))) {
tmp = t_2;
} else {
tmp = (y / a) - ((x / a) / z);
}
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 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = y / (t_1 / -z);
} else if ((t_2 <= -2e-311) || (!(t_2 <= 0.0) && (t_2 <= 5e+293))) {
tmp = t_2;
} else {
tmp = (y / a) - ((x / a) / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (x - (y * z)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = y / (t_1 / -z) elif (t_2 <= -2e-311) or (not (t_2 <= 0.0) and (t_2 <= 5e+293)): tmp = t_2 else: tmp = (y / a) - ((x / a) / z) return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(y / Float64(t_1 / Float64(-z))); elseif ((t_2 <= -2e-311) || (!(t_2 <= 0.0) && (t_2 <= 5e+293))) tmp = t_2; else tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (x - (y * z)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = y / (t_1 / -z); elseif ((t_2 <= -2e-311) || (~((t_2 <= 0.0)) && (t_2 <= 5e+293))) tmp = t_2; else tmp = (y / a) - ((x / a) / z); 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[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(y / N[(t$95$1 / (-z)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$2, -2e-311], And[N[Not[LessEqual[t$95$2, 0.0]], $MachinePrecision], LessEqual[t$95$2, 5e+293]]], t$95$2, N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x - y \cdot z}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{y}{\frac{t_1}{-z}}\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-311} \lor \neg \left(t_2 \leq 0\right) \land t_2 \leq 5 \cdot 10^{+293}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 41.3%
*-commutative41.3%
Simplified41.3%
Taylor expanded in x around 0 33.6%
associate-*r/33.6%
mul-1-neg33.6%
distribute-rgt-neg-out33.6%
associate-/l*92.0%
*-commutative92.0%
Simplified92.0%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.9999999999999e-311 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5.00000000000000033e293Initial program 99.7%
if -1.9999999999999e-311 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0 or 5.00000000000000033e293 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 39.9%
*-commutative39.9%
Simplified39.9%
Taylor expanded in z around inf 63.2%
+-commutative63.2%
associate--l+63.2%
associate-/r*73.3%
associate-*r/73.3%
associate-/r*73.4%
associate-*r/73.4%
div-sub73.4%
distribute-lft-out--73.4%
associate-*r/73.4%
mul-1-neg73.4%
unsub-neg73.4%
Simplified78.7%
Taylor expanded in x around inf 75.8%
associate-/r*85.9%
Simplified85.9%
Final simplification96.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= z -1.35e+125)
(/ y a)
(if (<= z 5.6e-61)
t_1
(if (<= z 1.4e+22)
(/ (* y (- z)) t)
(if (<= z 3.5e+66) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -1.35e+125) {
tmp = y / a;
} else if (z <= 5.6e-61) {
tmp = t_1;
} else if (z <= 1.4e+22) {
tmp = (y * -z) / t;
} else if (z <= 3.5e+66) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x / (t - (z * a))
if (z <= (-1.35d+125)) then
tmp = y / a
else if (z <= 5.6d-61) then
tmp = t_1
else if (z <= 1.4d+22) then
tmp = (y * -z) / t
else if (z <= 3.5d+66) then
tmp = t_1
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -1.35e+125) {
tmp = y / a;
} else if (z <= 5.6e-61) {
tmp = t_1;
} else if (z <= 1.4e+22) {
tmp = (y * -z) / t;
} else if (z <= 3.5e+66) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if z <= -1.35e+125: tmp = y / a elif z <= 5.6e-61: tmp = t_1 elif z <= 1.4e+22: tmp = (y * -z) / t elif z <= 3.5e+66: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (z <= -1.35e+125) tmp = Float64(y / a); elseif (z <= 5.6e-61) tmp = t_1; elseif (z <= 1.4e+22) tmp = Float64(Float64(y * Float64(-z)) / t); elseif (z <= 3.5e+66) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (z <= -1.35e+125) tmp = y / a; elseif (z <= 5.6e-61) tmp = t_1; elseif (z <= 1.4e+22) tmp = (y * -z) / t; elseif (z <= 3.5e+66) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+125], N[(y / a), $MachinePrecision], If[LessEqual[z, 5.6e-61], t$95$1, If[LessEqual[z, 1.4e+22], N[(N[(y * (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.5e+66], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+125}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+22}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.3499999999999999e125 or 3.4999999999999997e66 < z Initial program 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in z around inf 69.0%
if -1.3499999999999999e125 < z < 5.6000000000000002e-61 or 1.4e22 < z < 3.4999999999999997e66Initial program 96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in x around inf 73.7%
*-commutative73.7%
Simplified73.7%
if 5.6000000000000002e-61 < z < 1.4e22Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 70.8%
Taylor expanded in x around 0 54.6%
associate-*r*54.6%
neg-mul-154.6%
Simplified54.6%
Final simplification70.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) t)))
(if (<= z -2.7e+73)
(/ y a)
(if (<= z -1.3e-227)
t_1
(if (<= z 5.2e-62)
(/ x (- t (* z a)))
(if (<= z 1.02e+60) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / t;
double tmp;
if (z <= -2.7e+73) {
tmp = y / a;
} else if (z <= -1.3e-227) {
tmp = t_1;
} else if (z <= 5.2e-62) {
tmp = x / (t - (z * a));
} else if (z <= 1.02e+60) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x - (y * z)) / t
if (z <= (-2.7d+73)) then
tmp = y / a
else if (z <= (-1.3d-227)) then
tmp = t_1
else if (z <= 5.2d-62) then
tmp = x / (t - (z * a))
else if (z <= 1.02d+60) 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 - (y * z)) / t;
double tmp;
if (z <= -2.7e+73) {
tmp = y / a;
} else if (z <= -1.3e-227) {
tmp = t_1;
} else if (z <= 5.2e-62) {
tmp = x / (t - (z * a));
} else if (z <= 1.02e+60) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / t tmp = 0 if z <= -2.7e+73: tmp = y / a elif z <= -1.3e-227: tmp = t_1 elif z <= 5.2e-62: tmp = x / (t - (z * a)) elif z <= 1.02e+60: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / t) tmp = 0.0 if (z <= -2.7e+73) tmp = Float64(y / a); elseif (z <= -1.3e-227) tmp = t_1; elseif (z <= 5.2e-62) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 1.02e+60) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (y * z)) / t; tmp = 0.0; if (z <= -2.7e+73) tmp = y / a; elseif (z <= -1.3e-227) tmp = t_1; elseif (z <= 5.2e-62) tmp = x / (t - (z * a)); elseif (z <= 1.02e+60) 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[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -2.7e+73], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.3e-227], t$95$1, If[LessEqual[z, 5.2e-62], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+60], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t}\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+73}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-227}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-62}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.6999999999999999e73 or 1.0200000000000001e60 < z Initial program 62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in z around inf 66.4%
if -2.6999999999999999e73 < z < -1.30000000000000006e-227 or 5.1999999999999999e-62 < z < 1.0200000000000001e60Initial program 96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in t around inf 70.4%
if -1.30000000000000006e-227 < z < 5.1999999999999999e-62Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 86.8%
*-commutative86.8%
Simplified86.8%
Final simplification73.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.5e+73)
(/ y a)
(if (<= z -7e-165)
(- (/ x t) (* z (/ y t)))
(if (<= z 3e-62)
(/ x (- t (* z a)))
(if (<= z 2.1e+63) (/ (- x (* y z)) t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e+73) {
tmp = y / a;
} else if (z <= -7e-165) {
tmp = (x / t) - (z * (y / t));
} else if (z <= 3e-62) {
tmp = x / (t - (z * a));
} else if (z <= 2.1e+63) {
tmp = (x - (y * z)) / 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+73)) then
tmp = y / a
else if (z <= (-7d-165)) then
tmp = (x / t) - (z * (y / t))
else if (z <= 3d-62) then
tmp = x / (t - (z * a))
else if (z <= 2.1d+63) then
tmp = (x - (y * z)) / 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+73) {
tmp = y / a;
} else if (z <= -7e-165) {
tmp = (x / t) - (z * (y / t));
} else if (z <= 3e-62) {
tmp = x / (t - (z * a));
} else if (z <= 2.1e+63) {
tmp = (x - (y * z)) / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e+73: tmp = y / a elif z <= -7e-165: tmp = (x / t) - (z * (y / t)) elif z <= 3e-62: tmp = x / (t - (z * a)) elif z <= 2.1e+63: tmp = (x - (y * z)) / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e+73) tmp = Float64(y / a); elseif (z <= -7e-165) tmp = Float64(Float64(x / t) - Float64(z * Float64(y / t))); elseif (z <= 3e-62) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 2.1e+63) tmp = Float64(Float64(x - Float64(y * z)) / 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+73) tmp = y / a; elseif (z <= -7e-165) tmp = (x / t) - (z * (y / t)); elseif (z <= 3e-62) tmp = x / (t - (z * a)); elseif (z <= 2.1e+63) tmp = (x - (y * z)) / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e+73], N[(y / a), $MachinePrecision], If[LessEqual[z, -7e-165], N[(N[(x / t), $MachinePrecision] - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-62], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e+63], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+73}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-165}:\\
\;\;\;\;\frac{x}{t} - z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-62}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+63}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -7.5e73 or 2.1000000000000002e63 < z Initial program 62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in z around inf 66.4%
if -7.5e73 < z < -7.0000000000000003e-165Initial program 95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in t around inf 71.2%
div-sub71.2%
*-commutative71.2%
Applied egg-rr71.2%
clear-num71.3%
inv-pow71.3%
*-commutative71.3%
associate-/r*73.6%
Applied egg-rr73.6%
unpow-173.6%
Simplified73.6%
associate-/r/73.5%
clear-num73.6%
Applied egg-rr73.6%
if -7.0000000000000003e-165 < z < 3.0000000000000001e-62Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 84.1%
*-commutative84.1%
Simplified84.1%
if 3.0000000000000001e-62 < z < 2.1000000000000002e63Initial program 96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in t around inf 66.5%
Final simplification73.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.15e-10) (not (<= a 6.5e+33))) (- (/ y a) (/ (/ x a) z)) (+ (/ x t) (/ -1.0 (/ (/ t y) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.15e-10) || !(a <= 6.5e+33)) {
tmp = (y / a) - ((x / a) / z);
} else {
tmp = (x / t) + (-1.0 / ((t / y) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.15d-10)) .or. (.not. (a <= 6.5d+33))) then
tmp = (y / a) - ((x / a) / z)
else
tmp = (x / t) + ((-1.0d0) / ((t / y) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.15e-10) || !(a <= 6.5e+33)) {
tmp = (y / a) - ((x / a) / z);
} else {
tmp = (x / t) + (-1.0 / ((t / y) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.15e-10) or not (a <= 6.5e+33): tmp = (y / a) - ((x / a) / z) else: tmp = (x / t) + (-1.0 / ((t / y) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.15e-10) || !(a <= 6.5e+33)) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); else tmp = Float64(Float64(x / t) + Float64(-1.0 / Float64(Float64(t / y) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.15e-10) || ~((a <= 6.5e+33))) tmp = (y / a) - ((x / a) / z); else tmp = (x / t) + (-1.0 / ((t / y) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.15e-10], N[Not[LessEqual[a, 6.5e+33]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] + N[(-1.0 / N[(N[(t / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.15 \cdot 10^{-10} \lor \neg \left(a \leq 6.5 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} + \frac{-1}{\frac{\frac{t}{y}}{z}}\\
\end{array}
\end{array}
if a < -1.15000000000000004e-10 or 6.49999999999999993e33 < a Initial program 73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in z around inf 66.8%
+-commutative66.8%
associate--l+66.8%
associate-/r*69.7%
associate-*r/69.7%
associate-/r*69.7%
associate-*r/69.7%
div-sub69.7%
distribute-lft-out--69.7%
associate-*r/69.7%
mul-1-neg69.7%
unsub-neg69.7%
Simplified72.4%
Taylor expanded in x around inf 70.3%
associate-/r*73.2%
Simplified73.2%
if -1.15000000000000004e-10 < a < 6.49999999999999993e33Initial program 93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in t around inf 75.0%
div-sub75.0%
*-commutative75.0%
Applied egg-rr75.0%
clear-num74.4%
inv-pow74.4%
*-commutative74.4%
associate-/r*76.4%
Applied egg-rr76.4%
unpow-176.4%
Simplified76.4%
Final simplification74.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.12e+33)
(/ y a)
(if (<= z 3.4e-92)
(/ x t)
(if (<= z 5.6e-62)
(/ (- x) (* z a))
(if (<= z 6.8e+35)
(* z (/ (- y) t))
(if (<= z 3.7e+66) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.12e+33) {
tmp = y / a;
} else if (z <= 3.4e-92) {
tmp = x / t;
} else if (z <= 5.6e-62) {
tmp = -x / (z * a);
} else if (z <= 6.8e+35) {
tmp = z * (-y / t);
} else if (z <= 3.7e+66) {
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.12d+33)) then
tmp = y / a
else if (z <= 3.4d-92) then
tmp = x / t
else if (z <= 5.6d-62) then
tmp = -x / (z * a)
else if (z <= 6.8d+35) then
tmp = z * (-y / t)
else if (z <= 3.7d+66) 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.12e+33) {
tmp = y / a;
} else if (z <= 3.4e-92) {
tmp = x / t;
} else if (z <= 5.6e-62) {
tmp = -x / (z * a);
} else if (z <= 6.8e+35) {
tmp = z * (-y / t);
} else if (z <= 3.7e+66) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.12e+33: tmp = y / a elif z <= 3.4e-92: tmp = x / t elif z <= 5.6e-62: tmp = -x / (z * a) elif z <= 6.8e+35: tmp = z * (-y / t) elif z <= 3.7e+66: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.12e+33) tmp = Float64(y / a); elseif (z <= 3.4e-92) tmp = Float64(x / t); elseif (z <= 5.6e-62) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 6.8e+35) tmp = Float64(z * Float64(Float64(-y) / t)); elseif (z <= 3.7e+66) 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.12e+33) tmp = y / a; elseif (z <= 3.4e-92) tmp = x / t; elseif (z <= 5.6e-62) tmp = -x / (z * a); elseif (z <= 6.8e+35) tmp = z * (-y / t); elseif (z <= 3.7e+66) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.12e+33], N[(y / a), $MachinePrecision], If[LessEqual[z, 3.4e-92], N[(x / t), $MachinePrecision], If[LessEqual[z, 5.6e-62], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+35], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+66], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+33}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-92}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-62}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+35}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+66}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.12e33 or 3.7e66 < z Initial program 63.7%
*-commutative63.7%
Simplified63.7%
Taylor expanded in z around inf 63.1%
if -1.12e33 < z < 3.4000000000000003e-92 or 6.8000000000000002e35 < z < 3.7e66Initial program 99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in z around 0 61.5%
if 3.4000000000000003e-92 < z < 5.60000000000000005e-62Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in t around 0 75.6%
associate-*r/75.6%
neg-mul-175.6%
*-commutative75.6%
Simplified75.6%
if 5.60000000000000005e-62 < z < 6.8000000000000002e35Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 68.4%
div-sub68.4%
*-commutative68.4%
Applied egg-rr68.4%
clear-num68.4%
inv-pow68.4%
*-commutative68.4%
associate-/r*66.7%
Applied egg-rr66.7%
unpow-166.7%
Simplified66.7%
Taylor expanded in x around 0 53.8%
associate-*l/49.3%
*-commutative49.3%
neg-mul-149.3%
distribute-rgt-neg-in49.3%
Simplified49.3%
Final simplification61.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1e+33)
(/ y a)
(if (<= z 5.2e-92)
(/ x t)
(if (<= z 1.95e-71)
(/ (- x) (* z a))
(if (<= z 4.2e+30) (/ (* y (- z)) t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+33) {
tmp = y / a;
} else if (z <= 5.2e-92) {
tmp = x / t;
} else if (z <= 1.95e-71) {
tmp = -x / (z * a);
} else if (z <= 4.2e+30) {
tmp = (y * -z) / 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 <= (-1d+33)) then
tmp = y / a
else if (z <= 5.2d-92) then
tmp = x / t
else if (z <= 1.95d-71) then
tmp = -x / (z * a)
else if (z <= 4.2d+30) then
tmp = (y * -z) / 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 <= -1e+33) {
tmp = y / a;
} else if (z <= 5.2e-92) {
tmp = x / t;
} else if (z <= 1.95e-71) {
tmp = -x / (z * a);
} else if (z <= 4.2e+30) {
tmp = (y * -z) / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1e+33: tmp = y / a elif z <= 5.2e-92: tmp = x / t elif z <= 1.95e-71: tmp = -x / (z * a) elif z <= 4.2e+30: tmp = (y * -z) / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+33) tmp = Float64(y / a); elseif (z <= 5.2e-92) tmp = Float64(x / t); elseif (z <= 1.95e-71) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 4.2e+30) tmp = Float64(Float64(y * Float64(-z)) / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1e+33) tmp = y / a; elseif (z <= 5.2e-92) tmp = x / t; elseif (z <= 1.95e-71) tmp = -x / (z * a); elseif (z <= 4.2e+30) tmp = (y * -z) / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+33], N[(y / a), $MachinePrecision], If[LessEqual[z, 5.2e-92], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.95e-71], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+30], N[(N[(y * (-z)), $MachinePrecision] / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+33}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-92}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-71}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -9.9999999999999995e32 or 4.2e30 < z Initial program 65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in z around inf 60.8%
if -9.9999999999999995e32 < z < 5.2e-92Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 62.0%
if 5.2e-92 < z < 1.9500000000000001e-71Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in t around 0 75.6%
associate-*r/75.6%
neg-mul-175.6%
*-commutative75.6%
Simplified75.6%
if 1.9500000000000001e-71 < z < 4.2e30Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 68.4%
Taylor expanded in x around 0 53.8%
associate-*r*53.8%
neg-mul-153.8%
Simplified53.8%
Final simplification61.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.5e-11) (not (<= a 2.45e+33))) (- (/ y a) (/ (/ x a) z)) (- (/ x t) (* z (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.5e-11) || !(a <= 2.45e+33)) {
tmp = (y / a) - ((x / a) / z);
} else {
tmp = (x / t) - (z * (y / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-7.5d-11)) .or. (.not. (a <= 2.45d+33))) then
tmp = (y / a) - ((x / a) / z)
else
tmp = (x / t) - (z * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.5e-11) || !(a <= 2.45e+33)) {
tmp = (y / a) - ((x / a) / z);
} else {
tmp = (x / t) - (z * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.5e-11) or not (a <= 2.45e+33): tmp = (y / a) - ((x / a) / z) else: tmp = (x / t) - (z * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.5e-11) || !(a <= 2.45e+33)) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); else tmp = Float64(Float64(x / t) - Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7.5e-11) || ~((a <= 2.45e+33))) tmp = (y / a) - ((x / a) / z); else tmp = (x / t) - (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.5e-11], N[Not[LessEqual[a, 2.45e+33]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{-11} \lor \neg \left(a \leq 2.45 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} - z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if a < -7.5e-11 or 2.45000000000000007e33 < a Initial program 73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in z around inf 66.8%
+-commutative66.8%
associate--l+66.8%
associate-/r*69.7%
associate-*r/69.7%
associate-/r*69.7%
associate-*r/69.7%
div-sub69.7%
distribute-lft-out--69.7%
associate-*r/69.7%
mul-1-neg69.7%
unsub-neg69.7%
Simplified72.4%
Taylor expanded in x around inf 70.3%
associate-/r*73.2%
Simplified73.2%
if -7.5e-11 < a < 2.45000000000000007e33Initial program 93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in t around inf 75.0%
div-sub75.0%
*-commutative75.0%
Applied egg-rr75.0%
clear-num74.4%
inv-pow74.4%
*-commutative74.4%
associate-/r*76.4%
Applied egg-rr76.4%
unpow-176.4%
Simplified76.4%
associate-/r/75.2%
clear-num75.9%
Applied egg-rr75.9%
Final simplification74.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.12e+33)
(/ y a)
(if (<= z 6.5e-92)
(/ x t)
(if (<= z 1.5e+31)
(* z (/ (- y) t))
(if (<= z 6.5e+59) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.12e+33) {
tmp = y / a;
} else if (z <= 6.5e-92) {
tmp = x / t;
} else if (z <= 1.5e+31) {
tmp = z * (-y / t);
} else if (z <= 6.5e+59) {
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.12d+33)) then
tmp = y / a
else if (z <= 6.5d-92) then
tmp = x / t
else if (z <= 1.5d+31) then
tmp = z * (-y / t)
else if (z <= 6.5d+59) 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.12e+33) {
tmp = y / a;
} else if (z <= 6.5e-92) {
tmp = x / t;
} else if (z <= 1.5e+31) {
tmp = z * (-y / t);
} else if (z <= 6.5e+59) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.12e+33: tmp = y / a elif z <= 6.5e-92: tmp = x / t elif z <= 1.5e+31: tmp = z * (-y / t) elif z <= 6.5e+59: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.12e+33) tmp = Float64(y / a); elseif (z <= 6.5e-92) tmp = Float64(x / t); elseif (z <= 1.5e+31) tmp = Float64(z * Float64(Float64(-y) / t)); elseif (z <= 6.5e+59) 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.12e+33) tmp = y / a; elseif (z <= 6.5e-92) tmp = x / t; elseif (z <= 1.5e+31) tmp = z * (-y / t); elseif (z <= 6.5e+59) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.12e+33], N[(y / a), $MachinePrecision], If[LessEqual[z, 6.5e-92], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.5e+31], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+59], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+33}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-92}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+31}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.12e33 or 6.50000000000000021e59 < z Initial program 64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in z around inf 63.4%
if -1.12e33 < z < 6.50000000000000035e-92 or 1.49999999999999995e31 < z < 6.50000000000000021e59Initial program 99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in z around 0 61.9%
if 6.50000000000000035e-92 < z < 1.49999999999999995e31Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 56.7%
div-sub56.7%
*-commutative56.7%
Applied egg-rr56.7%
clear-num56.7%
inv-pow56.7%
*-commutative56.7%
associate-/r*55.4%
Applied egg-rr55.4%
unpow-155.4%
Simplified55.4%
Taylor expanded in x around 0 42.8%
associate-*l/39.6%
*-commutative39.6%
neg-mul-139.6%
distribute-rgt-neg-in39.6%
Simplified39.6%
Final simplification60.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e+33) (not (<= z 10.5))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e+33) || !(z <= 10.5)) {
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 <= (-1.15d+33)) .or. (.not. (z <= 10.5d0))) 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 <= -1.15e+33) || !(z <= 10.5)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e+33) or not (z <= 10.5): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.15e+33) || !(z <= 10.5)) 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 <= -1.15e+33) || ~((z <= 10.5))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e+33], N[Not[LessEqual[z, 10.5]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+33} \lor \neg \left(z \leq 10.5\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -1.15000000000000005e33 or 10.5 < z Initial program 67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in z around inf 59.6%
if -1.15000000000000005e33 < z < 10.5Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 55.9%
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 34.0%
Final simplification34.0%
(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 2023307
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))