
(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))))
(if (or (<= z -3.6e+121) (not (<= z 6.5e+202)))
(/ (- y (/ x z)) a)
(- (/ x t_1) (/ (* z y) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double tmp;
if ((z <= -3.6e+121) || !(z <= 6.5e+202)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t_1) - ((z * y) / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t - (z * a)
if ((z <= (-3.6d+121)) .or. (.not. (z <= 6.5d+202))) then
tmp = (y - (x / z)) / a
else
tmp = (x / t_1) - ((z * y) / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double tmp;
if ((z <= -3.6e+121) || !(z <= 6.5e+202)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t_1) - ((z * y) / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) tmp = 0 if (z <= -3.6e+121) or not (z <= 6.5e+202): tmp = (y - (x / z)) / a else: tmp = (x / t_1) - ((z * y) / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) tmp = 0.0 if ((z <= -3.6e+121) || !(z <= 6.5e+202)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x / t_1) - Float64(Float64(z * y) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); tmp = 0.0; if ((z <= -3.6e+121) || ~((z <= 6.5e+202))) tmp = (y - (x / z)) / a; else tmp = (x / t_1) - ((z * y) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -3.6e+121], N[Not[LessEqual[z, 6.5e+202]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / t$95$1), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+121} \lor \neg \left(z \leq 6.5 \cdot 10^{+202}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t_1} - \frac{z \cdot y}{t_1}\\
\end{array}
\end{array}
if z < -3.59999999999999981e121 or 6.4999999999999996e202 < z Initial program 56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in x around 0 56.5%
Taylor expanded in a around inf 84.3%
mul-1-neg84.3%
unsub-neg84.3%
Simplified84.3%
if -3.59999999999999981e121 < z < 6.4999999999999996e202Initial program 96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 96.7%
Final simplification93.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (* z (- a)))) (t_2 (* z (/ (- y) t))))
(if (<= z -2.6e+65)
(/ y a)
(if (<= z -3.2e+34)
t_2
(if (<= z -1.02e-8)
(/ y a)
(if (<= z -5.2e-30)
t_1
(if (<= z -7.2e-72)
t_2
(if (<= z 1.4e-76)
(/ x t)
(if (<= z 0.0118) t_2 (if (<= z 1.7e+33) t_1 (/ y a)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (z * -a);
double t_2 = z * (-y / t);
double tmp;
if (z <= -2.6e+65) {
tmp = y / a;
} else if (z <= -3.2e+34) {
tmp = t_2;
} else if (z <= -1.02e-8) {
tmp = y / a;
} else if (z <= -5.2e-30) {
tmp = t_1;
} else if (z <= -7.2e-72) {
tmp = t_2;
} else if (z <= 1.4e-76) {
tmp = x / t;
} else if (z <= 0.0118) {
tmp = t_2;
} else if (z <= 1.7e+33) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / (z * -a)
t_2 = z * (-y / t)
if (z <= (-2.6d+65)) then
tmp = y / a
else if (z <= (-3.2d+34)) then
tmp = t_2
else if (z <= (-1.02d-8)) then
tmp = y / a
else if (z <= (-5.2d-30)) then
tmp = t_1
else if (z <= (-7.2d-72)) then
tmp = t_2
else if (z <= 1.4d-76) then
tmp = x / t
else if (z <= 0.0118d0) then
tmp = t_2
else if (z <= 1.7d+33) then
tmp = t_1
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x / (z * -a);
double t_2 = z * (-y / t);
double tmp;
if (z <= -2.6e+65) {
tmp = y / a;
} else if (z <= -3.2e+34) {
tmp = t_2;
} else if (z <= -1.02e-8) {
tmp = y / a;
} else if (z <= -5.2e-30) {
tmp = t_1;
} else if (z <= -7.2e-72) {
tmp = t_2;
} else if (z <= 1.4e-76) {
tmp = x / t;
} else if (z <= 0.0118) {
tmp = t_2;
} else if (z <= 1.7e+33) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (z * -a) t_2 = z * (-y / t) tmp = 0 if z <= -2.6e+65: tmp = y / a elif z <= -3.2e+34: tmp = t_2 elif z <= -1.02e-8: tmp = y / a elif z <= -5.2e-30: tmp = t_1 elif z <= -7.2e-72: tmp = t_2 elif z <= 1.4e-76: tmp = x / t elif z <= 0.0118: tmp = t_2 elif z <= 1.7e+33: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(z * Float64(-a))) t_2 = Float64(z * Float64(Float64(-y) / t)) tmp = 0.0 if (z <= -2.6e+65) tmp = Float64(y / a); elseif (z <= -3.2e+34) tmp = t_2; elseif (z <= -1.02e-8) tmp = Float64(y / a); elseif (z <= -5.2e-30) tmp = t_1; elseif (z <= -7.2e-72) tmp = t_2; elseif (z <= 1.4e-76) tmp = Float64(x / t); elseif (z <= 0.0118) tmp = t_2; elseif (z <= 1.7e+33) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (z * -a); t_2 = z * (-y / t); tmp = 0.0; if (z <= -2.6e+65) tmp = y / a; elseif (z <= -3.2e+34) tmp = t_2; elseif (z <= -1.02e-8) tmp = y / a; elseif (z <= -5.2e-30) tmp = t_1; elseif (z <= -7.2e-72) tmp = t_2; elseif (z <= 1.4e-76) tmp = x / t; elseif (z <= 0.0118) tmp = t_2; elseif (z <= 1.7e+33) 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[(z * (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+65], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.2e+34], t$95$2, If[LessEqual[z, -1.02e-8], N[(y / a), $MachinePrecision], If[LessEqual[z, -5.2e-30], t$95$1, If[LessEqual[z, -7.2e-72], t$95$2, If[LessEqual[z, 1.4e-76], N[(x / t), $MachinePrecision], If[LessEqual[z, 0.0118], t$95$2, If[LessEqual[z, 1.7e+33], t$95$1, N[(y / a), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(-a\right)}\\
t_2 := z \cdot \frac{-y}{t}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+65}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-8}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-76}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 0.0118:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.60000000000000003e65 or -3.1999999999999998e34 < z < -1.02000000000000003e-8 or 1.7e33 < z Initial program 70.1%
*-commutative70.1%
Simplified70.1%
Taylor expanded in z around inf 67.2%
if -2.60000000000000003e65 < z < -3.1999999999999998e34 or -5.19999999999999973e-30 < z < -7.2e-72 or 1.40000000000000005e-76 < z < 0.0117999999999999997Initial program 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in t around inf 66.7%
Taylor expanded in x around 0 55.4%
associate-*r/55.4%
associate-*r*55.4%
*-rgt-identity55.4%
times-frac53.5%
associate-*r/53.5%
mul-1-neg53.5%
/-rgt-identity53.5%
Simplified53.5%
if -1.02000000000000003e-8 < z < -5.19999999999999973e-30 or 0.0117999999999999997 < z < 1.7e33Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 72.3%
*-commutative72.3%
Simplified72.3%
Taylor expanded in t around 0 42.9%
associate-*r*42.9%
neg-mul-142.9%
*-commutative42.9%
Simplified42.9%
if -7.2e-72 < z < 1.40000000000000005e-76Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 61.5%
Final simplification62.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (* z (- a)))) (t_2 (* z (/ (- y) t))))
(if (<= z -3.5e+58)
(/ y a)
(if (<= z -1.4e+39)
t_2
(if (<= z -2.3e-10)
(/ y a)
(if (<= z -6.9e-28)
t_1
(if (<= z -6.3e-71)
(/ (* z (- y)) t)
(if (<= z 5.5e-77)
(/ x t)
(if (<= z 3.9e-5) t_2 (if (<= z 6.4e+35) t_1 (/ y a)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (z * -a);
double t_2 = z * (-y / t);
double tmp;
if (z <= -3.5e+58) {
tmp = y / a;
} else if (z <= -1.4e+39) {
tmp = t_2;
} else if (z <= -2.3e-10) {
tmp = y / a;
} else if (z <= -6.9e-28) {
tmp = t_1;
} else if (z <= -6.3e-71) {
tmp = (z * -y) / t;
} else if (z <= 5.5e-77) {
tmp = x / t;
} else if (z <= 3.9e-5) {
tmp = t_2;
} else if (z <= 6.4e+35) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / (z * -a)
t_2 = z * (-y / t)
if (z <= (-3.5d+58)) then
tmp = y / a
else if (z <= (-1.4d+39)) then
tmp = t_2
else if (z <= (-2.3d-10)) then
tmp = y / a
else if (z <= (-6.9d-28)) then
tmp = t_1
else if (z <= (-6.3d-71)) then
tmp = (z * -y) / t
else if (z <= 5.5d-77) then
tmp = x / t
else if (z <= 3.9d-5) then
tmp = t_2
else if (z <= 6.4d+35) then
tmp = t_1
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x / (z * -a);
double t_2 = z * (-y / t);
double tmp;
if (z <= -3.5e+58) {
tmp = y / a;
} else if (z <= -1.4e+39) {
tmp = t_2;
} else if (z <= -2.3e-10) {
tmp = y / a;
} else if (z <= -6.9e-28) {
tmp = t_1;
} else if (z <= -6.3e-71) {
tmp = (z * -y) / t;
} else if (z <= 5.5e-77) {
tmp = x / t;
} else if (z <= 3.9e-5) {
tmp = t_2;
} else if (z <= 6.4e+35) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (z * -a) t_2 = z * (-y / t) tmp = 0 if z <= -3.5e+58: tmp = y / a elif z <= -1.4e+39: tmp = t_2 elif z <= -2.3e-10: tmp = y / a elif z <= -6.9e-28: tmp = t_1 elif z <= -6.3e-71: tmp = (z * -y) / t elif z <= 5.5e-77: tmp = x / t elif z <= 3.9e-5: tmp = t_2 elif z <= 6.4e+35: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(z * Float64(-a))) t_2 = Float64(z * Float64(Float64(-y) / t)) tmp = 0.0 if (z <= -3.5e+58) tmp = Float64(y / a); elseif (z <= -1.4e+39) tmp = t_2; elseif (z <= -2.3e-10) tmp = Float64(y / a); elseif (z <= -6.9e-28) tmp = t_1; elseif (z <= -6.3e-71) tmp = Float64(Float64(z * Float64(-y)) / t); elseif (z <= 5.5e-77) tmp = Float64(x / t); elseif (z <= 3.9e-5) tmp = t_2; elseif (z <= 6.4e+35) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (z * -a); t_2 = z * (-y / t); tmp = 0.0; if (z <= -3.5e+58) tmp = y / a; elseif (z <= -1.4e+39) tmp = t_2; elseif (z <= -2.3e-10) tmp = y / a; elseif (z <= -6.9e-28) tmp = t_1; elseif (z <= -6.3e-71) tmp = (z * -y) / t; elseif (z <= 5.5e-77) tmp = x / t; elseif (z <= 3.9e-5) tmp = t_2; elseif (z <= 6.4e+35) 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[(z * (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e+58], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.4e+39], t$95$2, If[LessEqual[z, -2.3e-10], N[(y / a), $MachinePrecision], If[LessEqual[z, -6.9e-28], t$95$1, If[LessEqual[z, -6.3e-71], N[(N[(z * (-y)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 5.5e-77], N[(x / t), $MachinePrecision], If[LessEqual[z, 3.9e-5], t$95$2, If[LessEqual[z, 6.4e+35], t$95$1, N[(y / a), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(-a\right)}\\
t_2 := z \cdot \frac{-y}{t}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{+39}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-10}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -6.9 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.3 \cdot 10^{-71}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-5}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.4999999999999997e58 or -1.40000000000000001e39 < z < -2.30000000000000007e-10 or 6.39999999999999965e35 < z Initial program 70.1%
*-commutative70.1%
Simplified70.1%
Taylor expanded in z around inf 67.2%
if -3.4999999999999997e58 < z < -1.40000000000000001e39 or 5.49999999999999998e-77 < z < 3.8999999999999999e-5Initial program 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in t around inf 70.9%
Taylor expanded in x around 0 58.7%
associate-*r/58.7%
associate-*r*58.7%
*-rgt-identity58.7%
times-frac58.7%
associate-*r/58.7%
mul-1-neg58.7%
/-rgt-identity58.7%
Simplified58.7%
if -2.30000000000000007e-10 < z < -6.90000000000000001e-28 or 3.8999999999999999e-5 < z < 6.39999999999999965e35Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 72.3%
*-commutative72.3%
Simplified72.3%
Taylor expanded in t around 0 42.9%
associate-*r*42.9%
neg-mul-142.9%
*-commutative42.9%
Simplified42.9%
if -6.90000000000000001e-28 < z < -6.3000000000000003e-71Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in t around inf 56.3%
Taylor expanded in x around 0 47.5%
associate-*r/47.5%
associate-*r*47.5%
mul-1-neg47.5%
Simplified47.5%
if -6.3000000000000003e-71 < z < 5.49999999999999998e-77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 61.5%
Final simplification62.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ (- y) t))))
(if (<= z -4.1e+58)
(/ y a)
(if (<= z -3.6e-71)
t_1
(if (<= z 2.15e-82)
(/ x t)
(if (<= z 1.2e-27) t_1 (if (<= z 12600000.0) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (-y / t);
double tmp;
if (z <= -4.1e+58) {
tmp = y / a;
} else if (z <= -3.6e-71) {
tmp = t_1;
} else if (z <= 2.15e-82) {
tmp = x / t;
} else if (z <= 1.2e-27) {
tmp = t_1;
} else if (z <= 12600000.0) {
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 = z * (-y / t)
if (z <= (-4.1d+58)) then
tmp = y / a
else if (z <= (-3.6d-71)) then
tmp = t_1
else if (z <= 2.15d-82) then
tmp = x / t
else if (z <= 1.2d-27) then
tmp = t_1
else if (z <= 12600000.0d0) 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 = z * (-y / t);
double tmp;
if (z <= -4.1e+58) {
tmp = y / a;
} else if (z <= -3.6e-71) {
tmp = t_1;
} else if (z <= 2.15e-82) {
tmp = x / t;
} else if (z <= 1.2e-27) {
tmp = t_1;
} else if (z <= 12600000.0) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (-y / t) tmp = 0 if z <= -4.1e+58: tmp = y / a elif z <= -3.6e-71: tmp = t_1 elif z <= 2.15e-82: tmp = x / t elif z <= 1.2e-27: tmp = t_1 elif z <= 12600000.0: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(Float64(-y) / t)) tmp = 0.0 if (z <= -4.1e+58) tmp = Float64(y / a); elseif (z <= -3.6e-71) tmp = t_1; elseif (z <= 2.15e-82) tmp = Float64(x / t); elseif (z <= 1.2e-27) tmp = t_1; elseif (z <= 12600000.0) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (-y / t); tmp = 0.0; if (z <= -4.1e+58) tmp = y / a; elseif (z <= -3.6e-71) tmp = t_1; elseif (z <= 2.15e-82) tmp = x / t; elseif (z <= 1.2e-27) tmp = t_1; elseif (z <= 12600000.0) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+58], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.6e-71], t$95$1, If[LessEqual[z, 2.15e-82], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.2e-27], t$95$1, If[LessEqual[z, 12600000.0], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{-y}{t}\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+58}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 12600000:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -4.1e58 or 1.26e7 < z Initial program 69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in z around inf 65.4%
if -4.1e58 < z < -3.6e-71 or 2.15000000000000009e-82 < z < 1.20000000000000001e-27Initial program 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in t around inf 57.1%
Taylor expanded in x around 0 47.7%
associate-*r/47.7%
associate-*r*47.7%
*-rgt-identity47.7%
times-frac46.1%
associate-*r/46.1%
mul-1-neg46.1%
/-rgt-identity46.1%
Simplified46.1%
if -3.6e-71 < z < 2.15000000000000009e-82 or 1.20000000000000001e-27 < z < 1.26e7Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 60.0%
Final simplification60.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.9e-24)
(/ x (- t (* z a)))
(if (or (<= a 1.35e-12) (and (not (<= a 5.8e+24)) (<= a 4.3e+72)))
(/ (- x (* z y)) t)
(/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.9e-24) {
tmp = x / (t - (z * a));
} else if ((a <= 1.35e-12) || (!(a <= 5.8e+24) && (a <= 4.3e+72))) {
tmp = (x - (z * y)) / 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 (a <= (-2.9d-24)) then
tmp = x / (t - (z * a))
else if ((a <= 1.35d-12) .or. (.not. (a <= 5.8d+24)) .and. (a <= 4.3d+72)) then
tmp = (x - (z * y)) / 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 (a <= -2.9e-24) {
tmp = x / (t - (z * a));
} else if ((a <= 1.35e-12) || (!(a <= 5.8e+24) && (a <= 4.3e+72))) {
tmp = (x - (z * y)) / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.9e-24: tmp = x / (t - (z * a)) elif (a <= 1.35e-12) or (not (a <= 5.8e+24) and (a <= 4.3e+72)): tmp = (x - (z * y)) / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.9e-24) tmp = Float64(x / Float64(t - Float64(z * a))); elseif ((a <= 1.35e-12) || (!(a <= 5.8e+24) && (a <= 4.3e+72))) tmp = Float64(Float64(x - Float64(z * y)) / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.9e-24) tmp = x / (t - (z * a)); elseif ((a <= 1.35e-12) || (~((a <= 5.8e+24)) && (a <= 4.3e+72))) tmp = (x - (z * y)) / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.9e-24], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 1.35e-12], And[N[Not[LessEqual[a, 5.8e+24]], $MachinePrecision], LessEqual[a, 4.3e+72]]], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-12} \lor \neg \left(a \leq 5.8 \cdot 10^{+24}\right) \land a \leq 4.3 \cdot 10^{+72}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if a < -2.8999999999999999e-24Initial program 85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in x around inf 63.9%
*-commutative63.9%
Simplified63.9%
if -2.8999999999999999e-24 < a < 1.3499999999999999e-12 or 5.79999999999999958e24 < a < 4.3000000000000001e72Initial program 93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in t around inf 72.7%
if 1.3499999999999999e-12 < a < 5.79999999999999958e24 or 4.3000000000000001e72 < a Initial program 73.0%
*-commutative73.0%
Simplified73.0%
Taylor expanded in z around inf 63.2%
Final simplification68.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.32e+70)
(/ y a)
(if (<= z -5.8e+35)
(* z (/ (- y) t))
(if (<= z 1.55e+33) (/ x (- t (* z a))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.32e+70) {
tmp = y / a;
} else if (z <= -5.8e+35) {
tmp = z * (-y / t);
} else if (z <= 1.55e+33) {
tmp = x / (t - (z * a));
} 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.32d+70)) then
tmp = y / a
else if (z <= (-5.8d+35)) then
tmp = z * (-y / t)
else if (z <= 1.55d+33) then
tmp = x / (t - (z * a))
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.32e+70) {
tmp = y / a;
} else if (z <= -5.8e+35) {
tmp = z * (-y / t);
} else if (z <= 1.55e+33) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.32e+70: tmp = y / a elif z <= -5.8e+35: tmp = z * (-y / t) elif z <= 1.55e+33: tmp = x / (t - (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.32e+70) tmp = Float64(y / a); elseif (z <= -5.8e+35) tmp = Float64(z * Float64(Float64(-y) / t)); elseif (z <= 1.55e+33) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.32e+70) tmp = y / a; elseif (z <= -5.8e+35) tmp = z * (-y / t); elseif (z <= 1.55e+33) tmp = x / (t - (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.32e+70], N[(y / a), $MachinePrecision], If[LessEqual[z, -5.8e+35], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+33], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+70}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{+35}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.3199999999999999e70 or 1.55e33 < z Initial program 68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in z around inf 67.6%
if -1.3199999999999999e70 < z < -5.79999999999999989e35Initial program 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in t around inf 88.8%
Taylor expanded in x around 0 83.9%
associate-*r/83.9%
associate-*r*83.9%
*-rgt-identity83.9%
times-frac83.9%
associate-*r/83.9%
mul-1-neg83.9%
/-rgt-identity83.9%
Simplified83.9%
if -5.79999999999999989e35 < z < 1.55e33Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 68.3%
*-commutative68.3%
Simplified68.3%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.8e+121) (not (<= z 6.8e+202))) (/ (- y (/ x z)) a) (/ (- x (* z y)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e+121) || !(z <= 6.8e+202)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-5.8d+121)) .or. (.not. (z <= 6.8d+202))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (z * y)) / (t - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e+121) || !(z <= 6.8e+202)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.8e+121) or not (z <= 6.8e+202): tmp = (y - (x / z)) / a else: tmp = (x - (z * y)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.8e+121) || !(z <= 6.8e+202)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.8e+121) || ~((z <= 6.8e+202))) tmp = (y - (x / z)) / a; else tmp = (x - (z * y)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.8e+121], N[Not[LessEqual[z, 6.8e+202]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+121} \lor \neg \left(z \leq 6.8 \cdot 10^{+202}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -5.7999999999999998e121 or 6.8e202 < z Initial program 56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in x around 0 56.5%
Taylor expanded in a around inf 84.3%
mul-1-neg84.3%
unsub-neg84.3%
Simplified84.3%
if -5.7999999999999998e121 < z < 6.8e202Initial program 96.6%
Final simplification93.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.6e-56) (not (<= t 8.2e+45))) (- (/ x t) (* y (/ z t))) (/ (- y (/ x z)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.6e-56) || !(t <= 8.2e+45)) {
tmp = (x / t) - (y * (z / t));
} else {
tmp = (y - (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 ((t <= (-4.6d-56)) .or. (.not. (t <= 8.2d+45))) then
tmp = (x / t) - (y * (z / t))
else
tmp = (y - (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 ((t <= -4.6e-56) || !(t <= 8.2e+45)) {
tmp = (x / t) - (y * (z / t));
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.6e-56) or not (t <= 8.2e+45): tmp = (x / t) - (y * (z / t)) else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.6e-56) || !(t <= 8.2e+45)) tmp = Float64(Float64(x / t) - Float64(y * Float64(z / t))); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.6e-56) || ~((t <= 8.2e+45))) tmp = (x / t) - (y * (z / t)); else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.6e-56], N[Not[LessEqual[t, 8.2e+45]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{-56} \lor \neg \left(t \leq 8.2 \cdot 10^{+45}\right):\\
\;\;\;\;\frac{x}{t} - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if t < -4.60000000000000005e-56 or 8.20000000000000025e45 < t Initial program 83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in x around 0 83.3%
Taylor expanded in a around 0 65.8%
+-commutative65.8%
neg-mul-165.8%
sub-neg65.8%
*-lft-identity65.8%
times-frac67.6%
/-rgt-identity67.6%
Simplified67.6%
if -4.60000000000000005e-56 < t < 8.20000000000000025e45Initial program 88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in x around 0 88.2%
Taylor expanded in a around inf 77.4%
mul-1-neg77.4%
unsub-neg77.4%
Simplified77.4%
Final simplification72.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.6e-56) (+ (/ x t) (/ -1.0 (/ (/ t z) y))) (if (<= t 4.6e+45) (/ (- y (/ x z)) a) (- (/ x t) (* y (/ z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.6e-56) {
tmp = (x / t) + (-1.0 / ((t / z) / y));
} else if (t <= 4.6e+45) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - (y * (z / 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 (t <= (-5.6d-56)) then
tmp = (x / t) + ((-1.0d0) / ((t / z) / y))
else if (t <= 4.6d+45) then
tmp = (y - (x / z)) / a
else
tmp = (x / t) - (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.6e-56) {
tmp = (x / t) + (-1.0 / ((t / z) / y));
} else if (t <= 4.6e+45) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.6e-56: tmp = (x / t) + (-1.0 / ((t / z) / y)) elif t <= 4.6e+45: tmp = (y - (x / z)) / a else: tmp = (x / t) - (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.6e-56) tmp = Float64(Float64(x / t) + Float64(-1.0 / Float64(Float64(t / z) / y))); elseif (t <= 4.6e+45) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x / t) - Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.6e-56) tmp = (x / t) + (-1.0 / ((t / z) / y)); elseif (t <= 4.6e+45) tmp = (y - (x / z)) / a; else tmp = (x / t) - (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.6e-56], N[(N[(x / t), $MachinePrecision] + N[(-1.0 / N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+45], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / t), $MachinePrecision] - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{-56}:\\
\;\;\;\;\frac{x}{t} + \frac{-1}{\frac{\frac{t}{z}}{y}}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+45}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} - y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if t < -5.59999999999999986e-56Initial program 86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in x around 0 86.3%
Taylor expanded in a around 0 69.0%
+-commutative69.0%
neg-mul-169.0%
sub-neg69.0%
associate-/l*70.2%
Simplified70.2%
clear-num70.3%
inv-pow70.3%
associate-/l/69.0%
*-commutative69.0%
Applied egg-rr69.0%
unpow-169.0%
associate-/r*70.3%
Simplified70.3%
if -5.59999999999999986e-56 < t < 4.60000000000000025e45Initial program 88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in x around 0 88.2%
Taylor expanded in a around inf 77.4%
mul-1-neg77.4%
unsub-neg77.4%
Simplified77.4%
if 4.60000000000000025e45 < t Initial program 79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in x around 0 79.2%
Taylor expanded in a around 0 61.4%
+-commutative61.4%
neg-mul-161.4%
sub-neg61.4%
*-lft-identity61.4%
times-frac64.0%
/-rgt-identity64.0%
Simplified64.0%
Final simplification72.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4e-56) (not (<= t 2e+47))) (/ (- x (* z y)) t) (/ (- y (/ x z)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e-56) || !(t <= 2e+47)) {
tmp = (x - (z * y)) / t;
} else {
tmp = (y - (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 ((t <= (-4d-56)) .or. (.not. (t <= 2d+47))) then
tmp = (x - (z * y)) / t
else
tmp = (y - (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 ((t <= -4e-56) || !(t <= 2e+47)) {
tmp = (x - (z * y)) / t;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4e-56) or not (t <= 2e+47): tmp = (x - (z * y)) / t else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4e-56) || !(t <= 2e+47)) tmp = Float64(Float64(x - Float64(z * y)) / t); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4e-56) || ~((t <= 2e+47))) tmp = (x - (z * y)) / t; else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4e-56], N[Not[LessEqual[t, 2e+47]], $MachinePrecision]], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-56} \lor \neg \left(t \leq 2 \cdot 10^{+47}\right):\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if t < -4.0000000000000002e-56 or 2.0000000000000001e47 < t Initial program 83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 65.8%
if -4.0000000000000002e-56 < t < 2.0000000000000001e47Initial program 88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in x around 0 88.2%
Taylor expanded in a around inf 77.4%
mul-1-neg77.4%
unsub-neg77.4%
Simplified77.4%
Final simplification71.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.55e-73) (not (<= z 17500000000000.0))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.55e-73) || !(z <= 17500000000000.0)) {
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.55d-73)) .or. (.not. (z <= 17500000000000.0d0))) 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.55e-73) || !(z <= 17500000000000.0)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.55e-73) or not (z <= 17500000000000.0): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.55e-73) || !(z <= 17500000000000.0)) 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.55e-73) || ~((z <= 17500000000000.0))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.55e-73], N[Not[LessEqual[z, 17500000000000.0]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.55 \cdot 10^{-73} \lor \neg \left(z \leq 17500000000000\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -2.55e-73 or 1.75e13 < z Initial program 75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in z around inf 57.4%
if -2.55e-73 < z < 1.75e13Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 55.0%
Final simplification56.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 85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in z around 0 28.5%
Final simplification28.5%
(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 2024019
(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))))