
(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 (<= z -4.1e+135) (/ y (- a (/ t z))) (if (<= z 1.22e+110) (/ (- x (* z y)) (- t (* z a))) (/ (- y (/ x z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.1e+135) {
tmp = y / (a - (t / z));
} else if (z <= 1.22e+110) {
tmp = (x - (z * y)) / (t - (z * a));
} 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 (z <= (-4.1d+135)) then
tmp = y / (a - (t / z))
else if (z <= 1.22d+110) then
tmp = (x - (z * y)) / (t - (z * a))
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 (z <= -4.1e+135) {
tmp = y / (a - (t / z));
} else if (z <= 1.22e+110) {
tmp = (x - (z * y)) / (t - (z * a));
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.1e+135: tmp = y / (a - (t / z)) elif z <= 1.22e+110: tmp = (x - (z * y)) / (t - (z * a)) else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.1e+135) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (z <= 1.22e+110) tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); 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 (z <= -4.1e+135) tmp = y / (a - (t / z)); elseif (z <= 1.22e+110) tmp = (x - (z * y)) / (t - (z * a)); else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.1e+135], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.22e+110], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+135}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{+110}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -4.1e135Initial program 63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in x around 0 55.6%
associate-*r/55.6%
mul-1-neg55.6%
distribute-rgt-neg-out55.6%
*-commutative55.6%
associate-/l*63.7%
Simplified63.7%
Taylor expanded in t around 0 89.4%
associate-*r/89.4%
neg-mul-189.4%
Simplified89.4%
if -4.1e135 < z < 1.22000000000000002e110Initial program 97.6%
if 1.22000000000000002e110 < z Initial program 47.5%
*-commutative47.5%
Simplified47.5%
div-sub47.5%
Applied egg-rr47.5%
Taylor expanded in t around 0 82.7%
distribute-lft-out--82.7%
associate-/l/95.5%
div-sub95.4%
mul-1-neg95.4%
Simplified95.4%
Final simplification96.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))) (t_2 (/ y (- a (/ t z)))))
(if (<= z -8.2e+46)
t_2
(if (<= z -4.2e-30)
t_1
(if (<= z -2.2e-82)
t_2
(if (<= z 2.8e-41)
t_1
(if (or (<= z 5.8e-16) (and (not (<= z 1.05e+24)) (<= z 2.8e+110)))
t_2
(/ (- y (/ x z)) a))))))))
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 <= -8.2e+46) {
tmp = t_2;
} else if (z <= -4.2e-30) {
tmp = t_1;
} else if (z <= -2.2e-82) {
tmp = t_2;
} else if (z <= 2.8e-41) {
tmp = t_1;
} else if ((z <= 5.8e-16) || (!(z <= 1.05e+24) && (z <= 2.8e+110))) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / (t - (z * a))
t_2 = y / (a - (t / z))
if (z <= (-8.2d+46)) then
tmp = t_2
else if (z <= (-4.2d-30)) then
tmp = t_1
else if (z <= (-2.2d-82)) then
tmp = t_2
else if (z <= 2.8d-41) then
tmp = t_1
else if ((z <= 5.8d-16) .or. (.not. (z <= 1.05d+24)) .and. (z <= 2.8d+110)) then
tmp = t_2
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 t_1 = x / (t - (z * a));
double t_2 = y / (a - (t / z));
double tmp;
if (z <= -8.2e+46) {
tmp = t_2;
} else if (z <= -4.2e-30) {
tmp = t_1;
} else if (z <= -2.2e-82) {
tmp = t_2;
} else if (z <= 2.8e-41) {
tmp = t_1;
} else if ((z <= 5.8e-16) || (!(z <= 1.05e+24) && (z <= 2.8e+110))) {
tmp = t_2;
} else {
tmp = (y - (x / z)) / a;
}
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 <= -8.2e+46: tmp = t_2 elif z <= -4.2e-30: tmp = t_1 elif z <= -2.2e-82: tmp = t_2 elif z <= 2.8e-41: tmp = t_1 elif (z <= 5.8e-16) or (not (z <= 1.05e+24) and (z <= 2.8e+110)): tmp = t_2 else: tmp = (y - (x / z)) / a 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 <= -8.2e+46) tmp = t_2; elseif (z <= -4.2e-30) tmp = t_1; elseif (z <= -2.2e-82) tmp = t_2; elseif (z <= 2.8e-41) tmp = t_1; elseif ((z <= 5.8e-16) || (!(z <= 1.05e+24) && (z <= 2.8e+110))) tmp = t_2; else tmp = Float64(Float64(y - Float64(x / z)) / a); 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 <= -8.2e+46) tmp = t_2; elseif (z <= -4.2e-30) tmp = t_1; elseif (z <= -2.2e-82) tmp = t_2; elseif (z <= 2.8e-41) tmp = t_1; elseif ((z <= 5.8e-16) || (~((z <= 1.05e+24)) && (z <= 2.8e+110))) tmp = t_2; else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+46], t$95$2, If[LessEqual[z, -4.2e-30], t$95$1, If[LessEqual[z, -2.2e-82], t$95$2, If[LessEqual[z, 2.8e-41], t$95$1, If[Or[LessEqual[z, 5.8e-16], And[N[Not[LessEqual[z, 1.05e+24]], $MachinePrecision], LessEqual[z, 2.8e+110]]], t$95$2, N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]]]]]]
\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 -8.2 \cdot 10^{+46}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-82}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-16} \lor \neg \left(z \leq 1.05 \cdot 10^{+24}\right) \land z \leq 2.8 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -8.19999999999999999e46 or -4.2000000000000004e-30 < z < -2.19999999999999986e-82 or 2.8000000000000002e-41 < z < 5.7999999999999996e-16 or 1.0500000000000001e24 < z < 2.79999999999999987e110Initial program 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x around 0 66.0%
associate-*r/66.0%
mul-1-neg66.0%
distribute-rgt-neg-out66.0%
*-commutative66.0%
associate-/l*70.4%
Simplified70.4%
Taylor expanded in t around 0 82.9%
associate-*r/82.9%
neg-mul-182.9%
Simplified82.9%
if -8.19999999999999999e46 < z < -4.2000000000000004e-30 or -2.19999999999999986e-82 < z < 2.8000000000000002e-41Initial program 99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in x around inf 80.4%
*-commutative80.4%
Simplified80.4%
if 5.7999999999999996e-16 < z < 1.0500000000000001e24 or 2.79999999999999987e110 < z Initial program 57.9%
*-commutative57.9%
Simplified57.9%
div-sub57.9%
Applied egg-rr57.9%
Taylor expanded in t around 0 81.5%
distribute-lft-out--81.5%
associate-/l/91.8%
div-sub91.8%
mul-1-neg91.8%
Simplified91.8%
Final simplification83.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))) (t_2 (/ y (- a (/ t z)))))
(if (<= z -5.2e+47)
t_2
(if (<= z -3.6e-30)
t_1
(if (<= z -3.2e-160)
(* z (/ y (- (* z a) t)))
(if (<= z 9.2e-42)
t_1
(if (or (<= z 3.3e-16) (and (not (<= z 3.1e+26)) (<= z 1.3e+110)))
t_2
(/ (- y (/ x z)) a))))))))
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 <= -5.2e+47) {
tmp = t_2;
} else if (z <= -3.6e-30) {
tmp = t_1;
} else if (z <= -3.2e-160) {
tmp = z * (y / ((z * a) - t));
} else if (z <= 9.2e-42) {
tmp = t_1;
} else if ((z <= 3.3e-16) || (!(z <= 3.1e+26) && (z <= 1.3e+110))) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / (t - (z * a))
t_2 = y / (a - (t / z))
if (z <= (-5.2d+47)) then
tmp = t_2
else if (z <= (-3.6d-30)) then
tmp = t_1
else if (z <= (-3.2d-160)) then
tmp = z * (y / ((z * a) - t))
else if (z <= 9.2d-42) then
tmp = t_1
else if ((z <= 3.3d-16) .or. (.not. (z <= 3.1d+26)) .and. (z <= 1.3d+110)) then
tmp = t_2
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 t_1 = x / (t - (z * a));
double t_2 = y / (a - (t / z));
double tmp;
if (z <= -5.2e+47) {
tmp = t_2;
} else if (z <= -3.6e-30) {
tmp = t_1;
} else if (z <= -3.2e-160) {
tmp = z * (y / ((z * a) - t));
} else if (z <= 9.2e-42) {
tmp = t_1;
} else if ((z <= 3.3e-16) || (!(z <= 3.1e+26) && (z <= 1.3e+110))) {
tmp = t_2;
} else {
tmp = (y - (x / z)) / a;
}
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 <= -5.2e+47: tmp = t_2 elif z <= -3.6e-30: tmp = t_1 elif z <= -3.2e-160: tmp = z * (y / ((z * a) - t)) elif z <= 9.2e-42: tmp = t_1 elif (z <= 3.3e-16) or (not (z <= 3.1e+26) and (z <= 1.3e+110)): tmp = t_2 else: tmp = (y - (x / z)) / a 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 <= -5.2e+47) tmp = t_2; elseif (z <= -3.6e-30) tmp = t_1; elseif (z <= -3.2e-160) tmp = Float64(z * Float64(y / Float64(Float64(z * a) - t))); elseif (z <= 9.2e-42) tmp = t_1; elseif ((z <= 3.3e-16) || (!(z <= 3.1e+26) && (z <= 1.3e+110))) tmp = t_2; else tmp = Float64(Float64(y - Float64(x / z)) / a); 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 <= -5.2e+47) tmp = t_2; elseif (z <= -3.6e-30) tmp = t_1; elseif (z <= -3.2e-160) tmp = z * (y / ((z * a) - t)); elseif (z <= 9.2e-42) tmp = t_1; elseif ((z <= 3.3e-16) || (~((z <= 3.1e+26)) && (z <= 1.3e+110))) tmp = t_2; else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+47], t$95$2, If[LessEqual[z, -3.6e-30], t$95$1, If[LessEqual[z, -3.2e-160], N[(z * N[(y / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e-42], t$95$1, If[Or[LessEqual[z, 3.3e-16], And[N[Not[LessEqual[z, 3.1e+26]], $MachinePrecision], LessEqual[z, 1.3e+110]]], t$95$2, N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]]]]]]
\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 -5.2 \cdot 10^{+47}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-160}:\\
\;\;\;\;z \cdot \frac{y}{z \cdot a - t}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-16} \lor \neg \left(z \leq 3.1 \cdot 10^{+26}\right) \land z \leq 1.3 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -5.20000000000000007e47 or 9.20000000000000015e-42 < z < 3.29999999999999988e-16 or 3.1e26 < z < 1.3e110Initial program 78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in x around 0 65.1%
associate-*r/65.1%
mul-1-neg65.1%
distribute-rgt-neg-out65.1%
*-commutative65.1%
associate-/l*70.4%
Simplified70.4%
Taylor expanded in t around 0 85.4%
associate-*r/85.4%
neg-mul-185.4%
Simplified85.4%
if -5.20000000000000007e47 < z < -3.6000000000000003e-30 or -3.20000000000000009e-160 < z < 9.20000000000000015e-42Initial program 99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in x around inf 82.3%
*-commutative82.3%
Simplified82.3%
if -3.6000000000000003e-30 < z < -3.20000000000000009e-160Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 66.9%
associate-*r/66.9%
mul-1-neg66.9%
distribute-rgt-neg-out66.9%
*-commutative66.9%
associate-/l*51.7%
Simplified51.7%
frac-2neg51.7%
remove-double-neg51.7%
div-inv51.6%
sub-neg51.6%
distribute-neg-in51.6%
distribute-lft-neg-in51.6%
add-sqr-sqrt51.5%
sqrt-unprod51.6%
sqr-neg51.6%
sqrt-unprod0.0%
add-sqr-sqrt26.9%
distribute-lft-neg-in26.9%
add-sqr-sqrt26.9%
sqrt-unprod26.9%
sqr-neg26.9%
sqrt-unprod0.0%
add-sqr-sqrt51.6%
Applied egg-rr51.6%
Taylor expanded in y around 0 66.9%
expm1-log1p-u49.9%
expm1-udef12.0%
associate-/l*12.0%
*-commutative12.0%
associate-/r/15.7%
fma-neg15.7%
Applied egg-rr15.7%
expm1-def53.6%
expm1-log1p70.7%
*-commutative70.7%
fma-def70.7%
unsub-neg70.7%
Simplified70.7%
if 3.29999999999999988e-16 < z < 3.1e26 or 1.3e110 < z Initial program 57.9%
*-commutative57.9%
Simplified57.9%
div-sub57.9%
Applied egg-rr57.9%
Taylor expanded in t around 0 81.5%
distribute-lft-out--81.5%
associate-/l/91.8%
div-sub91.8%
mul-1-neg91.8%
Simplified91.8%
Final simplification84.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x) (* z a))))
(if (<= z -5.2e+84)
(/ y a)
(if (<= z -1.65e-22)
t_1
(if (<= z -2.3e-30)
(/ x t)
(if (<= z -3.2e-160)
(/ (* y (- z)) t)
(if (<= z 1.18e-161)
(/ x t)
(if (<= z 1.65e-73)
t_1
(if (<= z 1.15e-42) (/ x t) (/ y a))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -x / (z * a);
double tmp;
if (z <= -5.2e+84) {
tmp = y / a;
} else if (z <= -1.65e-22) {
tmp = t_1;
} else if (z <= -2.3e-30) {
tmp = x / t;
} else if (z <= -3.2e-160) {
tmp = (y * -z) / t;
} else if (z <= 1.18e-161) {
tmp = x / t;
} else if (z <= 1.65e-73) {
tmp = t_1;
} else if (z <= 1.15e-42) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = -x / (z * a)
if (z <= (-5.2d+84)) then
tmp = y / a
else if (z <= (-1.65d-22)) then
tmp = t_1
else if (z <= (-2.3d-30)) then
tmp = x / t
else if (z <= (-3.2d-160)) then
tmp = (y * -z) / t
else if (z <= 1.18d-161) then
tmp = x / t
else if (z <= 1.65d-73) then
tmp = t_1
else if (z <= 1.15d-42) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -x / (z * a);
double tmp;
if (z <= -5.2e+84) {
tmp = y / a;
} else if (z <= -1.65e-22) {
tmp = t_1;
} else if (z <= -2.3e-30) {
tmp = x / t;
} else if (z <= -3.2e-160) {
tmp = (y * -z) / t;
} else if (z <= 1.18e-161) {
tmp = x / t;
} else if (z <= 1.65e-73) {
tmp = t_1;
} else if (z <= 1.15e-42) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -x / (z * a) tmp = 0 if z <= -5.2e+84: tmp = y / a elif z <= -1.65e-22: tmp = t_1 elif z <= -2.3e-30: tmp = x / t elif z <= -3.2e-160: tmp = (y * -z) / t elif z <= 1.18e-161: tmp = x / t elif z <= 1.65e-73: tmp = t_1 elif z <= 1.15e-42: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-x) / Float64(z * a)) tmp = 0.0 if (z <= -5.2e+84) tmp = Float64(y / a); elseif (z <= -1.65e-22) tmp = t_1; elseif (z <= -2.3e-30) tmp = Float64(x / t); elseif (z <= -3.2e-160) tmp = Float64(Float64(y * Float64(-z)) / t); elseif (z <= 1.18e-161) tmp = Float64(x / t); elseif (z <= 1.65e-73) tmp = t_1; elseif (z <= 1.15e-42) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -x / (z * a); tmp = 0.0; if (z <= -5.2e+84) tmp = y / a; elseif (z <= -1.65e-22) tmp = t_1; elseif (z <= -2.3e-30) tmp = x / t; elseif (z <= -3.2e-160) tmp = (y * -z) / t; elseif (z <= 1.18e-161) tmp = x / t; elseif (z <= 1.65e-73) tmp = t_1; elseif (z <= 1.15e-42) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+84], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.65e-22], t$95$1, If[LessEqual[z, -2.3e-30], N[(x / t), $MachinePrecision], If[LessEqual[z, -3.2e-160], N[(N[(y * (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.18e-161], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.65e-73], t$95$1, If[LessEqual[z, 1.15e-42], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot a}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+84}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-160}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-161}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-42}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.2000000000000002e84 or 1.15000000000000002e-42 < z Initial program 68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in z around inf 62.0%
if -5.2000000000000002e84 < z < -1.65e-22 or 1.17999999999999992e-161 < z < 1.65000000000000002e-73Initial program 97.5%
*-commutative97.5%
Simplified97.5%
div-sub97.5%
Applied egg-rr97.5%
Taylor expanded in t around 0 68.9%
distribute-lft-out--68.9%
associate-/l/64.4%
div-sub64.4%
mul-1-neg64.4%
Simplified64.4%
Taylor expanded in x around inf 54.8%
*-commutative54.8%
Simplified54.8%
if -1.65e-22 < z < -2.29999999999999984e-30 or -3.20000000000000009e-160 < z < 1.17999999999999992e-161 or 1.65000000000000002e-73 < z < 1.15000000000000002e-42Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 71.5%
if -2.29999999999999984e-30 < z < -3.20000000000000009e-160Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 65.5%
associate-*r/65.5%
associate-*r*65.5%
neg-mul-165.5%
*-commutative65.5%
Simplified65.5%
Taylor expanded in t around inf 48.8%
Final simplification62.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= z -1.3e+89)
(/ y a)
(if (<= z -8.5e-40)
t_1
(if (<= z -6e-165)
(/ (- x (* z y)) t)
(if (<= z 3.3e+27) 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.3e+89) {
tmp = y / a;
} else if (z <= -8.5e-40) {
tmp = t_1;
} else if (z <= -6e-165) {
tmp = (x - (z * y)) / t;
} else if (z <= 3.3e+27) {
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.3d+89)) then
tmp = y / a
else if (z <= (-8.5d-40)) then
tmp = t_1
else if (z <= (-6d-165)) then
tmp = (x - (z * y)) / t
else if (z <= 3.3d+27) 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.3e+89) {
tmp = y / a;
} else if (z <= -8.5e-40) {
tmp = t_1;
} else if (z <= -6e-165) {
tmp = (x - (z * y)) / t;
} else if (z <= 3.3e+27) {
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.3e+89: tmp = y / a elif z <= -8.5e-40: tmp = t_1 elif z <= -6e-165: tmp = (x - (z * y)) / t elif z <= 3.3e+27: 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.3e+89) tmp = Float64(y / a); elseif (z <= -8.5e-40) tmp = t_1; elseif (z <= -6e-165) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 3.3e+27) 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.3e+89) tmp = y / a; elseif (z <= -8.5e-40) tmp = t_1; elseif (z <= -6e-165) tmp = (x - (z * y)) / t; elseif (z <= 3.3e+27) 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.3e+89], N[(y / a), $MachinePrecision], If[LessEqual[z, -8.5e-40], t$95$1, If[LessEqual[z, -6e-165], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.3e+27], 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.3 \cdot 10^{+89}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-165}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.3e89 or 3.2999999999999998e27 < z Initial program 61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in z around inf 67.4%
if -1.3e89 < z < -8.4999999999999998e-40 or -5.99999999999999958e-165 < z < 3.2999999999999998e27Initial program 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x around inf 73.5%
*-commutative73.5%
Simplified73.5%
if -8.4999999999999998e-40 < z < -5.99999999999999958e-165Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 68.8%
Final simplification70.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x) (* z a))))
(if (<= z -1.2e+86)
(/ y a)
(if (<= z -2.45e-23)
t_1
(if (<= z 2.15e-161)
(/ x t)
(if (<= z 7.6e-74) t_1 (if (<= z 2.6e-39) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -x / (z * a);
double tmp;
if (z <= -1.2e+86) {
tmp = y / a;
} else if (z <= -2.45e-23) {
tmp = t_1;
} else if (z <= 2.15e-161) {
tmp = x / t;
} else if (z <= 7.6e-74) {
tmp = t_1;
} else if (z <= 2.6e-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) :: t_1
real(8) :: tmp
t_1 = -x / (z * a)
if (z <= (-1.2d+86)) then
tmp = y / a
else if (z <= (-2.45d-23)) then
tmp = t_1
else if (z <= 2.15d-161) then
tmp = x / t
else if (z <= 7.6d-74) then
tmp = t_1
else if (z <= 2.6d-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 t_1 = -x / (z * a);
double tmp;
if (z <= -1.2e+86) {
tmp = y / a;
} else if (z <= -2.45e-23) {
tmp = t_1;
} else if (z <= 2.15e-161) {
tmp = x / t;
} else if (z <= 7.6e-74) {
tmp = t_1;
} else if (z <= 2.6e-39) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -x / (z * a) tmp = 0 if z <= -1.2e+86: tmp = y / a elif z <= -2.45e-23: tmp = t_1 elif z <= 2.15e-161: tmp = x / t elif z <= 7.6e-74: tmp = t_1 elif z <= 2.6e-39: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-x) / Float64(z * a)) tmp = 0.0 if (z <= -1.2e+86) tmp = Float64(y / a); elseif (z <= -2.45e-23) tmp = t_1; elseif (z <= 2.15e-161) tmp = Float64(x / t); elseif (z <= 7.6e-74) tmp = t_1; elseif (z <= 2.6e-39) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -x / (z * a); tmp = 0.0; if (z <= -1.2e+86) tmp = y / a; elseif (z <= -2.45e-23) tmp = t_1; elseif (z <= 2.15e-161) tmp = x / t; elseif (z <= 7.6e-74) tmp = t_1; elseif (z <= 2.6e-39) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+86], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.45e-23], t$95$1, If[LessEqual[z, 2.15e-161], N[(x / t), $MachinePrecision], If[LessEqual[z, 7.6e-74], t$95$1, If[LessEqual[z, 2.6e-39], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot a}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+86}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-161}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-74}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-39}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.2e86 or 2.6e-39 < z Initial program 68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in z around inf 62.0%
if -1.2e86 < z < -2.4499999999999999e-23 or 2.14999999999999983e-161 < z < 7.5999999999999993e-74Initial program 97.5%
*-commutative97.5%
Simplified97.5%
div-sub97.5%
Applied egg-rr97.5%
Taylor expanded in t around 0 68.9%
distribute-lft-out--68.9%
associate-/l/64.4%
div-sub64.4%
mul-1-neg64.4%
Simplified64.4%
Taylor expanded in x around inf 54.8%
*-commutative54.8%
Simplified54.8%
if -2.4499999999999999e-23 < z < 2.14999999999999983e-161 or 7.5999999999999993e-74 < z < 2.6e-39Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 60.1%
Final simplification60.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -3.6e-46)
t_1
(if (<= z -3.5e-167)
(/ (- x (* z y)) t)
(if (<= z 1.16e-39) (/ x (- t (* z a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -3.6e-46) {
tmp = t_1;
} else if (z <= -3.5e-167) {
tmp = (x - (z * y)) / t;
} else if (z <= 1.16e-39) {
tmp = x / (t - (z * a));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y - (x / z)) / a
if (z <= (-3.6d-46)) then
tmp = t_1
else if (z <= (-3.5d-167)) then
tmp = (x - (z * y)) / t
else if (z <= 1.16d-39) then
tmp = x / (t - (z * a))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -3.6e-46) {
tmp = t_1;
} else if (z <= -3.5e-167) {
tmp = (x - (z * y)) / t;
} else if (z <= 1.16e-39) {
tmp = x / (t - (z * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -3.6e-46: tmp = t_1 elif z <= -3.5e-167: tmp = (x - (z * y)) / t elif z <= 1.16e-39: tmp = x / (t - (z * a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -3.6e-46) tmp = t_1; elseif (z <= -3.5e-167) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 1.16e-39) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; tmp = 0.0; if (z <= -3.6e-46) tmp = t_1; elseif (z <= -3.5e-167) tmp = (x - (z * y)) / t; elseif (z <= 1.16e-39) tmp = x / (t - (z * a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -3.6e-46], t$95$1, If[LessEqual[z, -3.5e-167], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.16e-39], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-39}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.6e-46 or 1.16e-39 < z Initial program 74.1%
*-commutative74.1%
Simplified74.1%
div-sub74.1%
Applied egg-rr74.1%
Taylor expanded in t around 0 72.5%
distribute-lft-out--72.5%
associate-/l/76.7%
div-sub76.7%
mul-1-neg76.7%
Simplified76.7%
if -3.6e-46 < z < -3.4999999999999999e-167Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 73.1%
if -3.4999999999999999e-167 < z < 1.16e-39Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 84.5%
*-commutative84.5%
Simplified84.5%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.2e-15) (not (<= t 3.5e+77))) (- (/ x t) (/ z (/ t y))) (/ (- y (/ x z)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.2e-15) || !(t <= 3.5e+77)) {
tmp = (x / t) - (z / (t / y));
} 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 <= (-1.2d-15)) .or. (.not. (t <= 3.5d+77))) then
tmp = (x / t) - (z / (t / y))
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 <= -1.2e-15) || !(t <= 3.5e+77)) {
tmp = (x / t) - (z / (t / y));
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.2e-15) or not (t <= 3.5e+77): tmp = (x / t) - (z / (t / y)) else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.2e-15) || !(t <= 3.5e+77)) tmp = Float64(Float64(x / t) - Float64(z / Float64(t / y))); 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 <= -1.2e-15) || ~((t <= 3.5e+77))) tmp = (x / t) - (z / (t / y)); else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.2e-15], N[Not[LessEqual[t, 3.5e+77]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-15} \lor \neg \left(t \leq 3.5 \cdot 10^{+77}\right):\\
\;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if t < -1.19999999999999997e-15 or 3.5000000000000001e77 < t Initial program 84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in t around inf 67.2%
div-sub67.2%
*-commutative67.2%
associate-/l*72.6%
Applied egg-rr72.6%
if -1.19999999999999997e-15 < t < 3.5000000000000001e77Initial program 84.1%
*-commutative84.1%
Simplified84.1%
div-sub84.1%
Applied egg-rr84.1%
Taylor expanded in t around 0 78.9%
distribute-lft-out--78.9%
associate-/l/79.5%
div-sub80.3%
mul-1-neg80.3%
Simplified80.3%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.4e-13) (- (/ x t) (* z (/ y t))) (if (<= t 4.6e+79) (/ (- y (/ x z)) a) (- (/ x t) (/ z (/ t y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.4e-13) {
tmp = (x / t) - (z * (y / t));
} else if (t <= 4.6e+79) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - (z / (t / y));
}
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 <= (-2.4d-13)) then
tmp = (x / t) - (z * (y / t))
else if (t <= 4.6d+79) then
tmp = (y - (x / z)) / a
else
tmp = (x / t) - (z / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.4e-13) {
tmp = (x / t) - (z * (y / t));
} else if (t <= 4.6e+79) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - (z / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.4e-13: tmp = (x / t) - (z * (y / t)) elif t <= 4.6e+79: tmp = (y - (x / z)) / a else: tmp = (x / t) - (z / (t / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.4e-13) tmp = Float64(Float64(x / t) - Float64(z * Float64(y / t))); elseif (t <= 4.6e+79) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x / t) - Float64(z / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.4e-13) tmp = (x / t) - (z * (y / t)); elseif (t <= 4.6e+79) tmp = (y - (x / z)) / a; else tmp = (x / t) - (z / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.4e-13], N[(N[(x / t), $MachinePrecision] - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+79], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / t), $MachinePrecision] - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-13}:\\
\;\;\;\;\frac{x}{t} - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+79}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if t < -2.3999999999999999e-13Initial program 87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in z around 0 71.7%
Taylor expanded in y around inf 71.8%
associate-*r/71.8%
mul-1-neg71.8%
Simplified71.8%
if -2.3999999999999999e-13 < t < 4.6000000000000001e79Initial program 84.1%
*-commutative84.1%
Simplified84.1%
div-sub84.1%
Applied egg-rr84.1%
Taylor expanded in t around 0 78.9%
distribute-lft-out--78.9%
associate-/l/79.5%
div-sub80.3%
mul-1-neg80.3%
Simplified80.3%
if 4.6000000000000001e79 < t Initial program 79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in t around inf 65.2%
div-sub65.3%
*-commutative65.3%
associate-/l*75.6%
Applied egg-rr75.6%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e+87) (not (<= z 8.5e+26))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+87) || !(z <= 8.5e+26)) {
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 <= (-4.5d+87)) .or. (.not. (z <= 8.5d+26))) 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 <= -4.5e+87) || !(z <= 8.5e+26)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e+87) or not (z <= 8.5e+26): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e+87) || !(z <= 8.5e+26)) 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 <= -4.5e+87) || ~((z <= 8.5e+26))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e+87], N[Not[LessEqual[z, 8.5e+26]], $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 -4.5 \cdot 10^{+87} \lor \neg \left(z \leq 8.5 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -4.5000000000000003e87 or 8.5e26 < z Initial program 61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in z around inf 67.4%
if -4.5000000000000003e87 < z < 8.5e26Initial program 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in x around inf 69.2%
*-commutative69.2%
Simplified69.2%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.4e-46) (not (<= z 2.4e-39))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e-46) || !(z <= 2.4e-39)) {
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 <= (-3.4d-46)) .or. (.not. (z <= 2.4d-39))) 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 <= -3.4e-46) || !(z <= 2.4e-39)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.4e-46) or not (z <= 2.4e-39): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.4e-46) || !(z <= 2.4e-39)) 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 <= -3.4e-46) || ~((z <= 2.4e-39))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.4e-46], N[Not[LessEqual[z, 2.4e-39]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-46} \lor \neg \left(z \leq 2.4 \cdot 10^{-39}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -3.39999999999999996e-46 or 2.40000000000000016e-39 < z Initial program 74.1%
*-commutative74.1%
Simplified74.1%
Taylor expanded in z around inf 55.8%
if -3.39999999999999996e-46 < z < 2.40000000000000016e-39Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.3%
Final simplification56.3%
(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.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in z around 0 29.7%
Final simplification29.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
(if (< z -32113435955957344.0)
t_2
(if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (a * z)
t_2 = (x / t_1) - (y / ((t / z) - a))
if (z < (-32113435955957344.0d0)) then
tmp = t_2
else if (z < 3.5139522372978296d-86) then
tmp = (x - (y * z)) * (1.0d0 / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) t_2 = (x / t_1) - (y / ((t / z) - a)) tmp = 0 if z < -32113435955957344.0: tmp = t_2 elif z < 3.5139522372978296e-86: tmp = (x - (y * z)) * (1.0 / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))) tmp = 0.0 if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); t_2 = (x / t_1) - (y / ((t / z) - a)); tmp = 0.0; if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = (x - (y * z)) * (1.0 / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023326
(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))))