
(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 -1.55e+56) (not (<= z 3e+95))) (/ y (- a (/ t z))) (/ (- x (* z y)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.55e+56) || !(z <= 3e+95)) {
tmp = y / (a - (t / z));
} 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 <= (-1.55d+56)) .or. (.not. (z <= 3d+95))) then
tmp = y / (a - (t / z))
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 <= -1.55e+56) || !(z <= 3e+95)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.55e+56) or not (z <= 3e+95): tmp = y / (a - (t / z)) else: tmp = (x - (z * y)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.55e+56) || !(z <= 3e+95)) tmp = Float64(y / Float64(a - Float64(t / z))); 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 <= -1.55e+56) || ~((z <= 3e+95))) tmp = y / (a - (t / z)); else tmp = (x - (z * y)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.55e+56], N[Not[LessEqual[z, 3e+95]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $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 -1.55 \cdot 10^{+56} \lor \neg \left(z \leq 3 \cdot 10^{+95}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -1.55000000000000002e56 or 2.99999999999999991e95 < z Initial program 58.5%
*-commutative58.5%
Simplified58.5%
Taylor expanded in x around 0 42.0%
associate-*r/42.0%
mul-1-neg42.0%
distribute-rgt-neg-out42.0%
associate-/l*55.7%
*-commutative55.7%
Simplified55.7%
Taylor expanded in t around 0 80.4%
mul-1-neg80.4%
unsub-neg80.4%
Simplified80.4%
if -1.55000000000000002e56 < z < 2.99999999999999991e95Initial program 99.2%
Final simplification92.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))) (t_2 (/ y (- a (/ t z)))))
(if (<= z -2e+22)
t_2
(if (<= z -6e-34)
t_1
(if (<= z -4.5e-138)
(/ (- x (* z y)) t)
(if (or (<= z 6.4e-77) (and (not (<= z 9.2e+14)) (<= z 2.5e+45)))
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 / (a - (t / z));
double tmp;
if (z <= -2e+22) {
tmp = t_2;
} else if (z <= -6e-34) {
tmp = t_1;
} else if (z <= -4.5e-138) {
tmp = (x - (z * y)) / t;
} else if ((z <= 6.4e-77) || (!(z <= 9.2e+14) && (z <= 2.5e+45))) {
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 / (a - (t / z))
if (z <= (-2d+22)) then
tmp = t_2
else if (z <= (-6d-34)) then
tmp = t_1
else if (z <= (-4.5d-138)) then
tmp = (x - (z * y)) / t
else if ((z <= 6.4d-77) .or. (.not. (z <= 9.2d+14)) .and. (z <= 2.5d+45)) 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 / (a - (t / z));
double tmp;
if (z <= -2e+22) {
tmp = t_2;
} else if (z <= -6e-34) {
tmp = t_1;
} else if (z <= -4.5e-138) {
tmp = (x - (z * y)) / t;
} else if ((z <= 6.4e-77) || (!(z <= 9.2e+14) && (z <= 2.5e+45))) {
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 / (a - (t / z)) tmp = 0 if z <= -2e+22: tmp = t_2 elif z <= -6e-34: tmp = t_1 elif z <= -4.5e-138: tmp = (x - (z * y)) / t elif (z <= 6.4e-77) or (not (z <= 9.2e+14) and (z <= 2.5e+45)): 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(a - Float64(t / z))) tmp = 0.0 if (z <= -2e+22) tmp = t_2; elseif (z <= -6e-34) tmp = t_1; elseif (z <= -4.5e-138) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif ((z <= 6.4e-77) || (!(z <= 9.2e+14) && (z <= 2.5e+45))) 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 / (a - (t / z)); tmp = 0.0; if (z <= -2e+22) tmp = t_2; elseif (z <= -6e-34) tmp = t_1; elseif (z <= -4.5e-138) tmp = (x - (z * y)) / t; elseif ((z <= 6.4e-77) || (~((z <= 9.2e+14)) && (z <= 2.5e+45))) 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[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+22], t$95$2, If[LessEqual[z, -6e-34], t$95$1, If[LessEqual[z, -4.5e-138], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, 6.4e-77], And[N[Not[LessEqual[z, 9.2e+14]], $MachinePrecision], LessEqual[z, 2.5e+45]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
t_2 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+22}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-138}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-77} \lor \neg \left(z \leq 9.2 \cdot 10^{+14}\right) \land z \leq 2.5 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2e22 or 6.39999999999999999e-77 < z < 9.2e14 or 2.5e45 < z Initial program 67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in x around 0 48.7%
associate-*r/48.7%
mul-1-neg48.7%
distribute-rgt-neg-out48.7%
associate-/l*58.3%
*-commutative58.3%
Simplified58.3%
Taylor expanded in t around 0 77.1%
mul-1-neg77.1%
unsub-neg77.1%
Simplified77.1%
if -2e22 < z < -6e-34 or -4.50000000000000008e-138 < z < 6.39999999999999999e-77 or 9.2e14 < z < 2.5e45Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 84.0%
*-commutative84.0%
Simplified84.0%
if -6e-34 < z < -4.50000000000000008e-138Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 77.6%
Final simplification80.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ x t_1)) (t_3 (/ y (- a (/ t z)))))
(if (<= z -1.55e+22)
t_3
(if (<= z -5e-34)
t_2
(if (<= z -1.4e-134)
(/ (- x (* z y)) t)
(if (<= z 1.4e-76)
t_2
(if (<= z 1.25e+19)
(/ y (/ t_1 (- z)))
(if (<= z 1.9e+46) t_2 t_3))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = x / t_1;
double t_3 = y / (a - (t / z));
double tmp;
if (z <= -1.55e+22) {
tmp = t_3;
} else if (z <= -5e-34) {
tmp = t_2;
} else if (z <= -1.4e-134) {
tmp = (x - (z * y)) / t;
} else if (z <= 1.4e-76) {
tmp = t_2;
} else if (z <= 1.25e+19) {
tmp = y / (t_1 / -z);
} else if (z <= 1.9e+46) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = t - (z * a)
t_2 = x / t_1
t_3 = y / (a - (t / z))
if (z <= (-1.55d+22)) then
tmp = t_3
else if (z <= (-5d-34)) then
tmp = t_2
else if (z <= (-1.4d-134)) then
tmp = (x - (z * y)) / t
else if (z <= 1.4d-76) then
tmp = t_2
else if (z <= 1.25d+19) then
tmp = y / (t_1 / -z)
else if (z <= 1.9d+46) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = x / t_1;
double t_3 = y / (a - (t / z));
double tmp;
if (z <= -1.55e+22) {
tmp = t_3;
} else if (z <= -5e-34) {
tmp = t_2;
} else if (z <= -1.4e-134) {
tmp = (x - (z * y)) / t;
} else if (z <= 1.4e-76) {
tmp = t_2;
} else if (z <= 1.25e+19) {
tmp = y / (t_1 / -z);
} else if (z <= 1.9e+46) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = x / t_1 t_3 = y / (a - (t / z)) tmp = 0 if z <= -1.55e+22: tmp = t_3 elif z <= -5e-34: tmp = t_2 elif z <= -1.4e-134: tmp = (x - (z * y)) / t elif z <= 1.4e-76: tmp = t_2 elif z <= 1.25e+19: tmp = y / (t_1 / -z) elif z <= 1.9e+46: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(x / t_1) t_3 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -1.55e+22) tmp = t_3; elseif (z <= -5e-34) tmp = t_2; elseif (z <= -1.4e-134) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 1.4e-76) tmp = t_2; elseif (z <= 1.25e+19) tmp = Float64(y / Float64(t_1 / Float64(-z))); elseif (z <= 1.9e+46) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = x / t_1; t_3 = y / (a - (t / z)); tmp = 0.0; if (z <= -1.55e+22) tmp = t_3; elseif (z <= -5e-34) tmp = t_2; elseif (z <= -1.4e-134) tmp = (x - (z * y)) / t; elseif (z <= 1.4e-76) tmp = t_2; elseif (z <= 1.25e+19) tmp = y / (t_1 / -z); elseif (z <= 1.9e+46) tmp = t_2; else tmp = t_3; 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[(x / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e+22], t$95$3, If[LessEqual[z, -5e-34], t$95$2, If[LessEqual[z, -1.4e-134], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.4e-76], t$95$2, If[LessEqual[z, 1.25e+19], N[(y / N[(t$95$1 / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+46], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x}{t\_1}\\
t_3 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+22}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-134}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-76}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+19}:\\
\;\;\;\;\frac{y}{\frac{t\_1}{-z}}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -1.5500000000000001e22 or 1.9e46 < z Initial program 62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in x around 0 45.8%
associate-*r/45.8%
mul-1-neg45.8%
distribute-rgt-neg-out45.8%
associate-/l*58.1%
*-commutative58.1%
Simplified58.1%
Taylor expanded in t around 0 80.4%
mul-1-neg80.4%
unsub-neg80.4%
Simplified80.4%
if -1.5500000000000001e22 < z < -5.0000000000000003e-34 or -1.3999999999999999e-134 < z < 1.40000000000000005e-76 or 1.25e19 < z < 1.9e46Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 84.0%
*-commutative84.0%
Simplified84.0%
if -5.0000000000000003e-34 < z < -1.3999999999999999e-134Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 77.6%
if 1.40000000000000005e-76 < z < 1.25e19Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in x around 0 64.4%
associate-*r/64.4%
mul-1-neg64.4%
distribute-rgt-neg-out64.4%
associate-/l*59.3%
*-commutative59.3%
Simplified59.3%
Final simplification80.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ x t_1)) (t_3 (/ y (- a (/ t z)))))
(if (<= z -2.4e+22)
t_3
(if (<= z -6.4e-34)
t_2
(if (<= z -7e-134)
(/ (- x (* z y)) t)
(if (<= z 2.3e-76)
t_2
(if (<= z 3.1e+15)
(/ (* z (- y)) t_1)
(if (<= z 3.3e+47) t_2 t_3))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = x / t_1;
double t_3 = y / (a - (t / z));
double tmp;
if (z <= -2.4e+22) {
tmp = t_3;
} else if (z <= -6.4e-34) {
tmp = t_2;
} else if (z <= -7e-134) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.3e-76) {
tmp = t_2;
} else if (z <= 3.1e+15) {
tmp = (z * -y) / t_1;
} else if (z <= 3.3e+47) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = t - (z * a)
t_2 = x / t_1
t_3 = y / (a - (t / z))
if (z <= (-2.4d+22)) then
tmp = t_3
else if (z <= (-6.4d-34)) then
tmp = t_2
else if (z <= (-7d-134)) then
tmp = (x - (z * y)) / t
else if (z <= 2.3d-76) then
tmp = t_2
else if (z <= 3.1d+15) then
tmp = (z * -y) / t_1
else if (z <= 3.3d+47) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = x / t_1;
double t_3 = y / (a - (t / z));
double tmp;
if (z <= -2.4e+22) {
tmp = t_3;
} else if (z <= -6.4e-34) {
tmp = t_2;
} else if (z <= -7e-134) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.3e-76) {
tmp = t_2;
} else if (z <= 3.1e+15) {
tmp = (z * -y) / t_1;
} else if (z <= 3.3e+47) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = x / t_1 t_3 = y / (a - (t / z)) tmp = 0 if z <= -2.4e+22: tmp = t_3 elif z <= -6.4e-34: tmp = t_2 elif z <= -7e-134: tmp = (x - (z * y)) / t elif z <= 2.3e-76: tmp = t_2 elif z <= 3.1e+15: tmp = (z * -y) / t_1 elif z <= 3.3e+47: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(x / t_1) t_3 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -2.4e+22) tmp = t_3; elseif (z <= -6.4e-34) tmp = t_2; elseif (z <= -7e-134) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 2.3e-76) tmp = t_2; elseif (z <= 3.1e+15) tmp = Float64(Float64(z * Float64(-y)) / t_1); elseif (z <= 3.3e+47) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = x / t_1; t_3 = y / (a - (t / z)); tmp = 0.0; if (z <= -2.4e+22) tmp = t_3; elseif (z <= -6.4e-34) tmp = t_2; elseif (z <= -7e-134) tmp = (x - (z * y)) / t; elseif (z <= 2.3e-76) tmp = t_2; elseif (z <= 3.1e+15) tmp = (z * -y) / t_1; elseif (z <= 3.3e+47) tmp = t_2; else tmp = t_3; 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[(x / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+22], t$95$3, If[LessEqual[z, -6.4e-34], t$95$2, If[LessEqual[z, -7e-134], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.3e-76], t$95$2, If[LessEqual[z, 3.1e+15], N[(N[(z * (-y)), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 3.3e+47], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x}{t\_1}\\
t_3 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+22}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-134}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-76}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+15}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t\_1}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+47}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -2.4e22 or 3.2999999999999999e47 < z Initial program 62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in x around 0 45.8%
associate-*r/45.8%
mul-1-neg45.8%
distribute-rgt-neg-out45.8%
associate-/l*58.1%
*-commutative58.1%
Simplified58.1%
Taylor expanded in t around 0 80.4%
mul-1-neg80.4%
unsub-neg80.4%
Simplified80.4%
if -2.4e22 < z < -6.40000000000000005e-34 or -6.9999999999999997e-134 < z < 2.30000000000000006e-76 or 3.1e15 < z < 3.2999999999999999e47Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 84.0%
*-commutative84.0%
Simplified84.0%
if -6.40000000000000005e-34 < z < -6.9999999999999997e-134Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 77.6%
if 2.30000000000000006e-76 < z < 3.1e15Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in x around 0 64.4%
associate-*r/64.4%
associate-*r*64.4%
neg-mul-164.4%
*-commutative64.4%
Simplified64.4%
Final simplification80.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.6e+84)
(/ y a)
(if (<= z -1.55e+25)
(* y (/ (- z) t))
(if (<= z -9.2e+17)
(/ y a)
(if (<= z 1.22e-39)
(/ x t)
(if (<= z 5.1e+16)
(* z (/ (- y) t))
(if (<= z 4.4e+39) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.6e+84) {
tmp = y / a;
} else if (z <= -1.55e+25) {
tmp = y * (-z / t);
} else if (z <= -9.2e+17) {
tmp = y / a;
} else if (z <= 1.22e-39) {
tmp = x / t;
} else if (z <= 5.1e+16) {
tmp = z * (-y / t);
} else if (z <= 4.4e+39) {
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 <= (-4.6d+84)) then
tmp = y / a
else if (z <= (-1.55d+25)) then
tmp = y * (-z / t)
else if (z <= (-9.2d+17)) then
tmp = y / a
else if (z <= 1.22d-39) then
tmp = x / t
else if (z <= 5.1d+16) then
tmp = z * (-y / t)
else if (z <= 4.4d+39) 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 <= -4.6e+84) {
tmp = y / a;
} else if (z <= -1.55e+25) {
tmp = y * (-z / t);
} else if (z <= -9.2e+17) {
tmp = y / a;
} else if (z <= 1.22e-39) {
tmp = x / t;
} else if (z <= 5.1e+16) {
tmp = z * (-y / t);
} else if (z <= 4.4e+39) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.6e+84: tmp = y / a elif z <= -1.55e+25: tmp = y * (-z / t) elif z <= -9.2e+17: tmp = y / a elif z <= 1.22e-39: tmp = x / t elif z <= 5.1e+16: tmp = z * (-y / t) elif z <= 4.4e+39: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.6e+84) tmp = Float64(y / a); elseif (z <= -1.55e+25) tmp = Float64(y * Float64(Float64(-z) / t)); elseif (z <= -9.2e+17) tmp = Float64(y / a); elseif (z <= 1.22e-39) tmp = Float64(x / t); elseif (z <= 5.1e+16) tmp = Float64(z * Float64(Float64(-y) / t)); elseif (z <= 4.4e+39) 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 <= -4.6e+84) tmp = y / a; elseif (z <= -1.55e+25) tmp = y * (-z / t); elseif (z <= -9.2e+17) tmp = y / a; elseif (z <= 1.22e-39) tmp = x / t; elseif (z <= 5.1e+16) tmp = z * (-y / t); elseif (z <= 4.4e+39) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.6e+84], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.55e+25], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.2e+17], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.22e-39], N[(x / t), $MachinePrecision], If[LessEqual[z, 5.1e+16], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+39], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+84}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{+17}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{-39}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{+16}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+39}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -4.5999999999999998e84 or -1.5499999999999999e25 < z < -9.2e17 or 4.4000000000000003e39 < z Initial program 61.8%
*-commutative61.8%
Simplified61.8%
Taylor expanded in z around inf 57.7%
if -4.5999999999999998e84 < z < -1.5499999999999999e25Initial program 83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in t around inf 59.5%
Taylor expanded in x around 0 51.3%
mul-1-neg51.3%
*-commutative51.3%
associate-*l/67.1%
distribute-rgt-neg-in67.1%
Simplified67.1%
if -9.2e17 < z < 1.2200000000000001e-39 or 5.1e16 < z < 4.4000000000000003e39Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 62.6%
if 1.2200000000000001e-39 < z < 5.1e16Initial program 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in t around inf 42.9%
Taylor expanded in x around 0 44.0%
associate-*r/44.0%
mul-1-neg44.0%
Simplified44.0%
div-inv44.2%
distribute-rgt-neg-in44.2%
associate-*l*38.0%
add-sqr-sqrt0.0%
sqrt-unprod1.9%
sqr-neg1.9%
sqrt-unprod1.9%
add-sqr-sqrt1.9%
div-inv1.9%
Applied egg-rr1.9%
associate-*r/1.9%
add-sqr-sqrt0.5%
sqrt-unprod18.4%
sqr-neg18.4%
sqrt-unprod34.1%
add-sqr-sqrt44.0%
associate-*l/44.0%
associate-/r/35.7%
frac-2neg35.7%
distribute-neg-frac35.7%
remove-double-neg35.7%
distribute-frac-neg35.7%
associate-/l*44.0%
add-sqr-sqrt9.5%
sqrt-unprod11.4%
sqr-neg11.4%
sqrt-unprod1.4%
add-sqr-sqrt1.9%
associate-*l/1.9%
*-commutative1.9%
add-sqr-sqrt1.4%
sqrt-unprod11.4%
sqr-neg11.4%
sqrt-unprod9.5%
add-sqr-sqrt44.0%
Applied egg-rr44.0%
Final simplification60.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.5e+86)
(/ y a)
(if (<= z -3.9e+29)
(/ y (/ (- t) z))
(if (<= z -9.2e+17)
(/ y a)
(if (<= z 5.5e-40)
(/ x t)
(if (<= z 3.8e+14)
(* z (/ (- y) t))
(if (<= z 1e+41) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e+86) {
tmp = y / a;
} else if (z <= -3.9e+29) {
tmp = y / (-t / z);
} else if (z <= -9.2e+17) {
tmp = y / a;
} else if (z <= 5.5e-40) {
tmp = x / t;
} else if (z <= 3.8e+14) {
tmp = z * (-y / t);
} else if (z <= 1e+41) {
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+86)) then
tmp = y / a
else if (z <= (-3.9d+29)) then
tmp = y / (-t / z)
else if (z <= (-9.2d+17)) then
tmp = y / a
else if (z <= 5.5d-40) then
tmp = x / t
else if (z <= 3.8d+14) then
tmp = z * (-y / t)
else if (z <= 1d+41) 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+86) {
tmp = y / a;
} else if (z <= -3.9e+29) {
tmp = y / (-t / z);
} else if (z <= -9.2e+17) {
tmp = y / a;
} else if (z <= 5.5e-40) {
tmp = x / t;
} else if (z <= 3.8e+14) {
tmp = z * (-y / t);
} else if (z <= 1e+41) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e+86: tmp = y / a elif z <= -3.9e+29: tmp = y / (-t / z) elif z <= -9.2e+17: tmp = y / a elif z <= 5.5e-40: tmp = x / t elif z <= 3.8e+14: tmp = z * (-y / t) elif z <= 1e+41: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e+86) tmp = Float64(y / a); elseif (z <= -3.9e+29) tmp = Float64(y / Float64(Float64(-t) / z)); elseif (z <= -9.2e+17) tmp = Float64(y / a); elseif (z <= 5.5e-40) tmp = Float64(x / t); elseif (z <= 3.8e+14) tmp = Float64(z * Float64(Float64(-y) / t)); elseif (z <= 1e+41) 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+86) tmp = y / a; elseif (z <= -3.9e+29) tmp = y / (-t / z); elseif (z <= -9.2e+17) tmp = y / a; elseif (z <= 5.5e-40) tmp = x / t; elseif (z <= 3.8e+14) tmp = z * (-y / t); elseif (z <= 1e+41) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e+86], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.9e+29], N[(y / N[((-t) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.2e+17], N[(y / a), $MachinePrecision], If[LessEqual[z, 5.5e-40], N[(x / t), $MachinePrecision], If[LessEqual[z, 3.8e+14], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+41], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+86}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{+29}:\\
\;\;\;\;\frac{y}{\frac{-t}{z}}\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{+17}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-40}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+14}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{elif}\;z \leq 10^{+41}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -7.4999999999999997e86 or -3.89999999999999968e29 < z < -9.2e17 or 1.00000000000000001e41 < z Initial program 61.8%
*-commutative61.8%
Simplified61.8%
Taylor expanded in z around inf 57.7%
if -7.4999999999999997e86 < z < -3.89999999999999968e29Initial program 83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in x around 0 67.5%
associate-*r/67.5%
mul-1-neg67.5%
distribute-rgt-neg-out67.5%
associate-/l*83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in t around inf 67.5%
associate-*r/67.5%
neg-mul-167.5%
Simplified67.5%
if -9.2e17 < z < 5.50000000000000002e-40 or 3.8e14 < z < 1.00000000000000001e41Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 62.6%
if 5.50000000000000002e-40 < z < 3.8e14Initial program 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in t around inf 42.9%
Taylor expanded in x around 0 44.0%
associate-*r/44.0%
mul-1-neg44.0%
Simplified44.0%
div-inv44.2%
distribute-rgt-neg-in44.2%
associate-*l*38.0%
add-sqr-sqrt0.0%
sqrt-unprod1.9%
sqr-neg1.9%
sqrt-unprod1.9%
add-sqr-sqrt1.9%
div-inv1.9%
Applied egg-rr1.9%
associate-*r/1.9%
add-sqr-sqrt0.5%
sqrt-unprod18.4%
sqr-neg18.4%
sqrt-unprod34.1%
add-sqr-sqrt44.0%
associate-*l/44.0%
associate-/r/35.7%
frac-2neg35.7%
distribute-neg-frac35.7%
remove-double-neg35.7%
distribute-frac-neg35.7%
associate-/l*44.0%
add-sqr-sqrt9.5%
sqrt-unprod11.4%
sqr-neg11.4%
sqrt-unprod1.4%
add-sqr-sqrt1.9%
associate-*l/1.9%
*-commutative1.9%
add-sqr-sqrt1.4%
sqrt-unprod11.4%
sqr-neg11.4%
sqrt-unprod9.5%
add-sqr-sqrt44.0%
Applied egg-rr44.0%
Final simplification60.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.2e+84)
(/ y a)
(if (<= z -6.6e+25)
(/ y (/ (- t) z))
(if (<= z -6e+17)
(/ y a)
(if (<= z 5e-49)
(/ x t)
(if (<= z 2.2e+20)
(/ (/ (- x) a) z)
(if (<= z 4.8e+39) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+84) {
tmp = y / a;
} else if (z <= -6.6e+25) {
tmp = y / (-t / z);
} else if (z <= -6e+17) {
tmp = y / a;
} else if (z <= 5e-49) {
tmp = x / t;
} else if (z <= 2.2e+20) {
tmp = (-x / a) / z;
} else if (z <= 4.8e+39) {
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 <= (-4.2d+84)) then
tmp = y / a
else if (z <= (-6.6d+25)) then
tmp = y / (-t / z)
else if (z <= (-6d+17)) then
tmp = y / a
else if (z <= 5d-49) then
tmp = x / t
else if (z <= 2.2d+20) then
tmp = (-x / a) / z
else if (z <= 4.8d+39) 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 <= -4.2e+84) {
tmp = y / a;
} else if (z <= -6.6e+25) {
tmp = y / (-t / z);
} else if (z <= -6e+17) {
tmp = y / a;
} else if (z <= 5e-49) {
tmp = x / t;
} else if (z <= 2.2e+20) {
tmp = (-x / a) / z;
} else if (z <= 4.8e+39) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.2e+84: tmp = y / a elif z <= -6.6e+25: tmp = y / (-t / z) elif z <= -6e+17: tmp = y / a elif z <= 5e-49: tmp = x / t elif z <= 2.2e+20: tmp = (-x / a) / z elif z <= 4.8e+39: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e+84) tmp = Float64(y / a); elseif (z <= -6.6e+25) tmp = Float64(y / Float64(Float64(-t) / z)); elseif (z <= -6e+17) tmp = Float64(y / a); elseif (z <= 5e-49) tmp = Float64(x / t); elseif (z <= 2.2e+20) tmp = Float64(Float64(Float64(-x) / a) / z); elseif (z <= 4.8e+39) 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 <= -4.2e+84) tmp = y / a; elseif (z <= -6.6e+25) tmp = y / (-t / z); elseif (z <= -6e+17) tmp = y / a; elseif (z <= 5e-49) tmp = x / t; elseif (z <= 2.2e+20) tmp = (-x / a) / z; elseif (z <= 4.8e+39) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e+84], N[(y / a), $MachinePrecision], If[LessEqual[z, -6.6e+25], N[(y / N[((-t) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6e+17], N[(y / a), $MachinePrecision], If[LessEqual[z, 5e-49], N[(x / t), $MachinePrecision], If[LessEqual[z, 2.2e+20], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 4.8e+39], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+84}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{+25}:\\
\;\;\;\;\frac{y}{\frac{-t}{z}}\\
\mathbf{elif}\;z \leq -6 \cdot 10^{+17}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-49}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+20}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+39}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -4.20000000000000037e84 or -6.6000000000000002e25 < z < -6e17 or 4.8000000000000002e39 < z Initial program 61.8%
*-commutative61.8%
Simplified61.8%
Taylor expanded in z around inf 57.7%
if -4.20000000000000037e84 < z < -6.6000000000000002e25Initial program 83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in x around 0 67.5%
associate-*r/67.5%
mul-1-neg67.5%
distribute-rgt-neg-out67.5%
associate-/l*83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in t around inf 67.5%
associate-*r/67.5%
neg-mul-167.5%
Simplified67.5%
if -6e17 < z < 4.9999999999999999e-49 or 2.2e20 < z < 4.8000000000000002e39Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 63.5%
if 4.9999999999999999e-49 < z < 2.2e20Initial program 92.9%
*-commutative92.9%
Simplified92.9%
clear-num92.7%
associate-/r/92.7%
sub-neg92.7%
+-commutative92.7%
*-commutative92.7%
distribute-rgt-neg-in92.7%
fma-def92.7%
Applied egg-rr92.7%
Taylor expanded in a around inf 57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in z around 0 31.8%
mul-1-neg31.8%
associate-/r*38.7%
distribute-frac-neg38.7%
mul-1-neg38.7%
associate-*r/38.7%
neg-mul-138.7%
Simplified38.7%
Final simplification60.2%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -3.25e+22)
(not (or (<= z 2.25e-76) (and (not (<= z 1.9e+16)) (<= z 2e+46)))))
(/ y (- a (/ t z)))
(/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.25e+22) || !((z <= 2.25e-76) || (!(z <= 1.9e+16) && (z <= 2e+46)))) {
tmp = y / (a - (t / z));
} 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 <= (-3.25d+22)) .or. (.not. (z <= 2.25d-76) .or. (.not. (z <= 1.9d+16)) .and. (z <= 2d+46))) then
tmp = y / (a - (t / z))
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 <= -3.25e+22) || !((z <= 2.25e-76) || (!(z <= 1.9e+16) && (z <= 2e+46)))) {
tmp = y / (a - (t / z));
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.25e+22) or not ((z <= 2.25e-76) or (not (z <= 1.9e+16) and (z <= 2e+46))): tmp = y / (a - (t / z)) else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.25e+22) || !((z <= 2.25e-76) || (!(z <= 1.9e+16) && (z <= 2e+46)))) tmp = Float64(y / Float64(a - Float64(t / z))); 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 <= -3.25e+22) || ~(((z <= 2.25e-76) || (~((z <= 1.9e+16)) && (z <= 2e+46))))) tmp = y / (a - (t / z)); else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.25e+22], N[Not[Or[LessEqual[z, 2.25e-76], And[N[Not[LessEqual[z, 1.9e+16]], $MachinePrecision], LessEqual[z, 2e+46]]]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.25 \cdot 10^{+22} \lor \neg \left(z \leq 2.25 \cdot 10^{-76} \lor \neg \left(z \leq 1.9 \cdot 10^{+16}\right) \land z \leq 2 \cdot 10^{+46}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -3.2499999999999999e22 or 2.25e-76 < z < 1.9e16 or 2e46 < z Initial program 67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in x around 0 48.7%
associate-*r/48.7%
mul-1-neg48.7%
distribute-rgt-neg-out48.7%
associate-/l*58.3%
*-commutative58.3%
Simplified58.3%
Taylor expanded in t around 0 77.1%
mul-1-neg77.1%
unsub-neg77.1%
Simplified77.1%
if -3.2499999999999999e22 < z < 2.25e-76 or 1.9e16 < z < 2e46Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 79.3%
*-commutative79.3%
Simplified79.3%
Final simplification78.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.8e+50)
(/ y a)
(if (<= z 6e-39)
(/ x t)
(if (<= z 3.3e+18)
(* z (/ (- y) t))
(if (<= z 5.6e+40) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+50) {
tmp = y / a;
} else if (z <= 6e-39) {
tmp = x / t;
} else if (z <= 3.3e+18) {
tmp = z * (-y / t);
} else if (z <= 5.6e+40) {
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 <= (-4.8d+50)) then
tmp = y / a
else if (z <= 6d-39) then
tmp = x / t
else if (z <= 3.3d+18) then
tmp = z * (-y / t)
else if (z <= 5.6d+40) 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 <= -4.8e+50) {
tmp = y / a;
} else if (z <= 6e-39) {
tmp = x / t;
} else if (z <= 3.3e+18) {
tmp = z * (-y / t);
} else if (z <= 5.6e+40) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e+50: tmp = y / a elif z <= 6e-39: tmp = x / t elif z <= 3.3e+18: tmp = z * (-y / t) elif z <= 5.6e+40: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+50) tmp = Float64(y / a); elseif (z <= 6e-39) tmp = Float64(x / t); elseif (z <= 3.3e+18) tmp = Float64(z * Float64(Float64(-y) / t)); elseif (z <= 5.6e+40) 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 <= -4.8e+50) tmp = y / a; elseif (z <= 6e-39) tmp = x / t; elseif (z <= 3.3e+18) tmp = z * (-y / t); elseif (z <= 5.6e+40) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+50], N[(y / a), $MachinePrecision], If[LessEqual[z, 6e-39], N[(x / t), $MachinePrecision], If[LessEqual[z, 3.3e+18], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+40], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+50}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-39}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+18}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+40}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -4.8000000000000004e50 or 5.6000000000000003e40 < z Initial program 61.0%
*-commutative61.0%
Simplified61.0%
Taylor expanded in z around inf 56.1%
if -4.8000000000000004e50 < z < 6.00000000000000055e-39 or 3.3e18 < z < 5.6000000000000003e40Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 61.1%
if 6.00000000000000055e-39 < z < 3.3e18Initial program 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in t around inf 42.9%
Taylor expanded in x around 0 44.0%
associate-*r/44.0%
mul-1-neg44.0%
Simplified44.0%
div-inv44.2%
distribute-rgt-neg-in44.2%
associate-*l*38.0%
add-sqr-sqrt0.0%
sqrt-unprod1.9%
sqr-neg1.9%
sqrt-unprod1.9%
add-sqr-sqrt1.9%
div-inv1.9%
Applied egg-rr1.9%
associate-*r/1.9%
add-sqr-sqrt0.5%
sqrt-unprod18.4%
sqr-neg18.4%
sqrt-unprod34.1%
add-sqr-sqrt44.0%
associate-*l/44.0%
associate-/r/35.7%
frac-2neg35.7%
distribute-neg-frac35.7%
remove-double-neg35.7%
distribute-frac-neg35.7%
associate-/l*44.0%
add-sqr-sqrt9.5%
sqrt-unprod11.4%
sqr-neg11.4%
sqrt-unprod1.4%
add-sqr-sqrt1.9%
associate-*l/1.9%
*-commutative1.9%
add-sqr-sqrt1.4%
sqrt-unprod11.4%
sqr-neg11.4%
sqrt-unprod9.5%
add-sqr-sqrt44.0%
Applied egg-rr44.0%
Final simplification58.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+51) (not (<= z 8e+52))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+51) || !(z <= 8e+52)) {
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 <= (-3.2d+51)) .or. (.not. (z <= 8d+52))) 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 <= -3.2e+51) || !(z <= 8e+52)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e+51) or not (z <= 8e+52): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+51) || !(z <= 8e+52)) 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 <= -3.2e+51) || ~((z <= 8e+52))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+51], N[Not[LessEqual[z, 8e+52]], $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 -3.2 \cdot 10^{+51} \lor \neg \left(z \leq 8 \cdot 10^{+52}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -3.2000000000000002e51 or 7.9999999999999999e52 < z Initial program 60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in z around inf 56.6%
if -3.2000000000000002e51 < z < 7.9999999999999999e52Initial program 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in x around inf 72.7%
*-commutative72.7%
Simplified72.7%
Final simplification66.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.9e+44) (not (<= z 1.7e-76))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.9e+44) || !(z <= 1.7e-76)) {
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 <= (-2.9d+44)) .or. (.not. (z <= 1.7d-76))) 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 <= -2.9e+44) || !(z <= 1.7e-76)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.9e+44) or not (z <= 1.7e-76): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.9e+44) || !(z <= 1.7e-76)) 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 <= -2.9e+44) || ~((z <= 1.7e-76))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.9e+44], N[Not[LessEqual[z, 1.7e-76]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+44} \lor \neg \left(z \leq 1.7 \cdot 10^{-76}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -2.9000000000000002e44 or 1.7e-76 < z Initial program 67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in z around inf 50.5%
if -2.9000000000000002e44 < z < 1.7e-76Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 62.1%
Final simplification56.5%
(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 84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in z around 0 38.1%
Final simplification38.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 2024040
(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))))