
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma z (- a) t))
(t_2 (fma -1.0 (* y (/ z t_1)) (/ x t_1)))
(t_3 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_3 -2e+29)
t_2
(if (<= t_3 4e-32) t_3 (if (<= t_3 INFINITY) t_2 (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, -a, t);
double t_2 = fma(-1.0, (y * (z / t_1)), (x / t_1));
double t_3 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_3 <= -2e+29) {
tmp = t_2;
} else if (t_3 <= 4e-32) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(-a), t) t_2 = fma(-1.0, Float64(y * Float64(z / t_1)), Float64(x / t_1)) t_3 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_3 <= -2e+29) tmp = t_2; elseif (t_3 <= 4e-32) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * (-a) + t), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 * N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+29], t$95$2, If[LessEqual[t$95$3, 4e-32], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, -a, t\right)\\
t_2 := \mathsf{fma}\left(-1, y \cdot \frac{z}{t\_1}, \frac{x}{t\_1}\right)\\
t_3 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{-32}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.99999999999999983e29 or 4.00000000000000022e-32 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in x around 0 84.3%
fma-define84.3%
associate-/l*99.0%
cancel-sign-sub-inv99.0%
*-commutative99.0%
+-commutative99.0%
fma-define99.0%
cancel-sign-sub-inv99.0%
*-commutative99.0%
+-commutative99.0%
fma-define99.0%
Simplified99.0%
if -1.99999999999999983e29 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.00000000000000022e-32Initial program 91.4%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification95.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (- t (* z a))) (t_3 (/ (- x (* y z)) t_2)))
(if (<= t_3 (- INFINITY))
(* y (/ z t_1))
(if (<= t_3 -5e-313)
(+ (/ (* y z) t_1) (/ x t_2))
(if (<= t_3 0.0)
(/ (- y (/ x z)) a)
(if (<= t_3 5e+302)
t_3
(pow
(- (/ a y) (/ (- (/ t y) (* a (/ x (pow y 2.0)))) z))
-1.0)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = t - (z * a);
double t_3 = (x - (y * z)) / t_2;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = y * (z / t_1);
} else if (t_3 <= -5e-313) {
tmp = ((y * z) / t_1) + (x / t_2);
} else if (t_3 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_3 <= 5e+302) {
tmp = t_3;
} else {
tmp = pow(((a / y) - (((t / y) - (a * (x / pow(y, 2.0)))) / z)), -1.0);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = t - (z * a);
double t_3 = (x - (y * z)) / t_2;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = y * (z / t_1);
} else if (t_3 <= -5e-313) {
tmp = ((y * z) / t_1) + (x / t_2);
} else if (t_3 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_3 <= 5e+302) {
tmp = t_3;
} else {
tmp = Math.pow(((a / y) - (((t / y) - (a * (x / Math.pow(y, 2.0)))) / z)), -1.0);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = t - (z * a) t_3 = (x - (y * z)) / t_2 tmp = 0 if t_3 <= -math.inf: tmp = y * (z / t_1) elif t_3 <= -5e-313: tmp = ((y * z) / t_1) + (x / t_2) elif t_3 <= 0.0: tmp = (y - (x / z)) / a elif t_3 <= 5e+302: tmp = t_3 else: tmp = math.pow(((a / y) - (((t / y) - (a * (x / math.pow(y, 2.0)))) / z)), -1.0) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(t - Float64(z * a)) t_3 = Float64(Float64(x - Float64(y * z)) / t_2) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(y * Float64(z / t_1)); elseif (t_3 <= -5e-313) tmp = Float64(Float64(Float64(y * z) / t_1) + Float64(x / t_2)); elseif (t_3 <= 0.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (t_3 <= 5e+302) tmp = t_3; else tmp = Float64(Float64(a / y) - Float64(Float64(Float64(t / y) - Float64(a * Float64(x / (y ^ 2.0)))) / z)) ^ -1.0; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = t - (z * a); t_3 = (x - (y * z)) / t_2; tmp = 0.0; if (t_3 <= -Inf) tmp = y * (z / t_1); elseif (t_3 <= -5e-313) tmp = ((y * z) / t_1) + (x / t_2); elseif (t_3 <= 0.0) tmp = (y - (x / z)) / a; elseif (t_3 <= 5e+302) tmp = t_3; else tmp = ((a / y) - (((t / y) - (a * (x / (y ^ 2.0)))) / z)) ^ -1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-313], N[(N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$3, 5e+302], t$95$3, N[Power[N[(N[(a / y), $MachinePrecision] - N[(N[(N[(t / y), $MachinePrecision] - N[(a * N[(x / N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := t - z \cdot a\\
t_3 := \frac{x - y \cdot z}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{t\_1}\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-313}:\\
\;\;\;\;\frac{y \cdot z}{t\_1} + \frac{x}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{a}{y} - \frac{\frac{t}{y} - a \cdot \frac{x}{{y}^{2}}}{z}\right)}^{-1}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in x around 0 36.4%
associate-*r/36.4%
sub-neg36.4%
mul-1-neg36.4%
+-commutative36.4%
mul-1-neg36.4%
distribute-rgt-neg-in36.4%
fma-undefine36.4%
associate-*r/36.4%
neg-mul-136.4%
distribute-neg-frac236.4%
neg-sub036.4%
fma-undefine36.4%
distribute-rgt-neg-in36.4%
distribute-lft-neg-in36.4%
*-commutative36.4%
associate--r+36.4%
neg-sub036.4%
distribute-rgt-neg-out36.4%
remove-double-neg36.4%
Simplified36.4%
Taylor expanded in y around 0 36.4%
associate-/l*83.6%
*-commutative83.6%
Simplified83.6%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5.00000000002e-313Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
if -5.00000000002e-313 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 59.5%
fma-define59.5%
associate-/l*59.5%
cancel-sign-sub-inv59.5%
*-commutative59.5%
+-commutative59.5%
fma-define59.5%
cancel-sign-sub-inv59.5%
*-commutative59.5%
+-commutative59.5%
fma-define59.5%
Simplified59.5%
Taylor expanded in a around inf 78.7%
mul-1-neg78.7%
unsub-neg78.7%
Simplified78.7%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5e302Initial program 99.7%
if 5e302 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 29.3%
*-commutative29.3%
Simplified29.3%
clear-num29.3%
inv-pow29.3%
sub-neg29.3%
+-commutative29.3%
*-commutative29.3%
distribute-rgt-neg-in29.3%
fma-define29.3%
Applied egg-rr29.3%
Taylor expanded in z around -inf 80.1%
+-commutative80.1%
mul-1-neg80.1%
unsub-neg80.1%
associate-/l*83.3%
Simplified83.3%
Final simplification94.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_2 (- INFINITY))
(* y (/ z t_1))
(if (<= t_2 -5e-313)
t_2
(if (<= t_2 0.0)
(/ (- y (/ x z)) a)
(if (<= t_2 5e+302)
t_2
(if (<= t_2 INFINITY) (* z (/ y t_1)) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = y * (z / t_1);
} else if (t_2 <= -5e-313) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_2 <= 5e+302) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = z * (y / t_1);
} else {
tmp = y / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = y * (z / t_1);
} else if (t_2 <= -5e-313) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_2 <= 5e+302) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = z * (y / t_1);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = (x - (y * z)) / (t - (z * a)) tmp = 0 if t_2 <= -math.inf: tmp = y * (z / t_1) elif t_2 <= -5e-313: tmp = t_2 elif t_2 <= 0.0: tmp = (y - (x / z)) / a elif t_2 <= 5e+302: tmp = t_2 elif t_2 <= math.inf: tmp = z * (y / t_1) else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(y * Float64(z / t_1)); elseif (t_2 <= -5e-313) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (t_2 <= 5e+302) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(z * Float64(y / t_1)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = (x - (y * z)) / (t - (z * a)); tmp = 0.0; if (t_2 <= -Inf) tmp = y * (z / t_1); elseif (t_2 <= -5e-313) tmp = t_2; elseif (t_2 <= 0.0) tmp = (y - (x / z)) / a; elseif (t_2 <= 5e+302) tmp = t_2; elseif (t_2 <= Inf) tmp = z * (y / t_1); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-313], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, 5e+302], t$95$2, If[LessEqual[t$95$2, Infinity], N[(z * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{t\_1}\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-313}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;z \cdot \frac{y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in x around 0 36.4%
associate-*r/36.4%
sub-neg36.4%
mul-1-neg36.4%
+-commutative36.4%
mul-1-neg36.4%
distribute-rgt-neg-in36.4%
fma-undefine36.4%
associate-*r/36.4%
neg-mul-136.4%
distribute-neg-frac236.4%
neg-sub036.4%
fma-undefine36.4%
distribute-rgt-neg-in36.4%
distribute-lft-neg-in36.4%
*-commutative36.4%
associate--r+36.4%
neg-sub036.4%
distribute-rgt-neg-out36.4%
remove-double-neg36.4%
Simplified36.4%
Taylor expanded in y around 0 36.4%
associate-/l*83.6%
*-commutative83.6%
Simplified83.6%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5.00000000002e-313 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5e302Initial program 99.7%
if -5.00000000002e-313 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 59.5%
fma-define59.5%
associate-/l*59.5%
cancel-sign-sub-inv59.5%
*-commutative59.5%
+-commutative59.5%
fma-define59.5%
cancel-sign-sub-inv59.5%
*-commutative59.5%
+-commutative59.5%
fma-define59.5%
Simplified59.5%
Taylor expanded in a around inf 78.7%
mul-1-neg78.7%
unsub-neg78.7%
Simplified78.7%
if 5e302 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 43.9%
*-commutative43.9%
Simplified43.9%
Taylor expanded in x around 0 19.6%
associate-*r/19.6%
sub-neg19.6%
mul-1-neg19.6%
+-commutative19.6%
mul-1-neg19.6%
distribute-rgt-neg-in19.6%
fma-undefine19.6%
associate-*r/19.6%
neg-mul-119.6%
distribute-neg-frac219.6%
neg-sub019.6%
fma-undefine19.6%
distribute-rgt-neg-in19.6%
distribute-lft-neg-in19.6%
*-commutative19.6%
associate--r+19.6%
neg-sub019.6%
distribute-rgt-neg-out19.6%
remove-double-neg19.6%
Simplified19.6%
*-commutative19.6%
associate-/l*79.8%
fma-neg79.8%
Applied egg-rr79.8%
Taylor expanded in y around 0 79.8%
*-commutative79.8%
Simplified79.8%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification95.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (- t (* z a))) (t_3 (/ (- x (* y z)) t_2)))
(if (<= t_3 (- INFINITY))
(* y (/ z t_1))
(if (<= t_3 -5e-313)
(+ (/ (* y z) t_1) (/ x t_2))
(if (<= t_3 0.0)
(/ (- y (/ x z)) a)
(if (<= t_3 5e+302)
t_3
(if (<= t_3 INFINITY) (* z (/ y t_1)) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = t - (z * a);
double t_3 = (x - (y * z)) / t_2;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = y * (z / t_1);
} else if (t_3 <= -5e-313) {
tmp = ((y * z) / t_1) + (x / t_2);
} else if (t_3 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_3 <= 5e+302) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = z * (y / t_1);
} else {
tmp = y / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = t - (z * a);
double t_3 = (x - (y * z)) / t_2;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = y * (z / t_1);
} else if (t_3 <= -5e-313) {
tmp = ((y * z) / t_1) + (x / t_2);
} else if (t_3 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_3 <= 5e+302) {
tmp = t_3;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = z * (y / t_1);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = t - (z * a) t_3 = (x - (y * z)) / t_2 tmp = 0 if t_3 <= -math.inf: tmp = y * (z / t_1) elif t_3 <= -5e-313: tmp = ((y * z) / t_1) + (x / t_2) elif t_3 <= 0.0: tmp = (y - (x / z)) / a elif t_3 <= 5e+302: tmp = t_3 elif t_3 <= math.inf: tmp = z * (y / t_1) else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(t - Float64(z * a)) t_3 = Float64(Float64(x - Float64(y * z)) / t_2) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(y * Float64(z / t_1)); elseif (t_3 <= -5e-313) tmp = Float64(Float64(Float64(y * z) / t_1) + Float64(x / t_2)); elseif (t_3 <= 0.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (t_3 <= 5e+302) tmp = t_3; elseif (t_3 <= Inf) tmp = Float64(z * Float64(y / t_1)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = t - (z * a); t_3 = (x - (y * z)) / t_2; tmp = 0.0; if (t_3 <= -Inf) tmp = y * (z / t_1); elseif (t_3 <= -5e-313) tmp = ((y * z) / t_1) + (x / t_2); elseif (t_3 <= 0.0) tmp = (y - (x / z)) / a; elseif (t_3 <= 5e+302) tmp = t_3; elseif (t_3 <= Inf) tmp = z * (y / t_1); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-313], N[(N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$3, 5e+302], t$95$3, If[LessEqual[t$95$3, Infinity], N[(z * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := t - z \cdot a\\
t_3 := \frac{x - y \cdot z}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{t\_1}\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-313}:\\
\;\;\;\;\frac{y \cdot z}{t\_1} + \frac{x}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;z \cdot \frac{y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in x around 0 36.4%
associate-*r/36.4%
sub-neg36.4%
mul-1-neg36.4%
+-commutative36.4%
mul-1-neg36.4%
distribute-rgt-neg-in36.4%
fma-undefine36.4%
associate-*r/36.4%
neg-mul-136.4%
distribute-neg-frac236.4%
neg-sub036.4%
fma-undefine36.4%
distribute-rgt-neg-in36.4%
distribute-lft-neg-in36.4%
*-commutative36.4%
associate--r+36.4%
neg-sub036.4%
distribute-rgt-neg-out36.4%
remove-double-neg36.4%
Simplified36.4%
Taylor expanded in y around 0 36.4%
associate-/l*83.6%
*-commutative83.6%
Simplified83.6%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5.00000000002e-313Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
if -5.00000000002e-313 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 59.5%
fma-define59.5%
associate-/l*59.5%
cancel-sign-sub-inv59.5%
*-commutative59.5%
+-commutative59.5%
fma-define59.5%
cancel-sign-sub-inv59.5%
*-commutative59.5%
+-commutative59.5%
fma-define59.5%
Simplified59.5%
Taylor expanded in a around inf 78.7%
mul-1-neg78.7%
unsub-neg78.7%
Simplified78.7%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5e302Initial program 99.7%
if 5e302 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 43.9%
*-commutative43.9%
Simplified43.9%
Taylor expanded in x around 0 19.6%
associate-*r/19.6%
sub-neg19.6%
mul-1-neg19.6%
+-commutative19.6%
mul-1-neg19.6%
distribute-rgt-neg-in19.6%
fma-undefine19.6%
associate-*r/19.6%
neg-mul-119.6%
distribute-neg-frac219.6%
neg-sub019.6%
fma-undefine19.6%
distribute-rgt-neg-in19.6%
distribute-lft-neg-in19.6%
*-commutative19.6%
associate--r+19.6%
neg-sub019.6%
distribute-rgt-neg-out19.6%
remove-double-neg19.6%
Simplified19.6%
*-commutative19.6%
associate-/l*79.8%
fma-neg79.8%
Applied egg-rr79.8%
Taylor expanded in y around 0 79.8%
*-commutative79.8%
Simplified79.8%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification95.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- z) t))))
(if (<= z -3.8e+117)
(/ y a)
(if (<= z -8.4e+15)
t_1
(if (<= z -6.6e-7)
(/ y a)
(if (<= z 4.6e-12) (/ x t) (if (<= z 5.5e+81) t_1 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (-z / t);
double tmp;
if (z <= -3.8e+117) {
tmp = y / a;
} else if (z <= -8.4e+15) {
tmp = t_1;
} else if (z <= -6.6e-7) {
tmp = y / a;
} else if (z <= 4.6e-12) {
tmp = x / t;
} else if (z <= 5.5e+81) {
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 = y * (-z / t)
if (z <= (-3.8d+117)) then
tmp = y / a
else if (z <= (-8.4d+15)) then
tmp = t_1
else if (z <= (-6.6d-7)) then
tmp = y / a
else if (z <= 4.6d-12) then
tmp = x / t
else if (z <= 5.5d+81) 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 = y * (-z / t);
double tmp;
if (z <= -3.8e+117) {
tmp = y / a;
} else if (z <= -8.4e+15) {
tmp = t_1;
} else if (z <= -6.6e-7) {
tmp = y / a;
} else if (z <= 4.6e-12) {
tmp = x / t;
} else if (z <= 5.5e+81) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (-z / t) tmp = 0 if z <= -3.8e+117: tmp = y / a elif z <= -8.4e+15: tmp = t_1 elif z <= -6.6e-7: tmp = y / a elif z <= 4.6e-12: tmp = x / t elif z <= 5.5e+81: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(-z) / t)) tmp = 0.0 if (z <= -3.8e+117) tmp = Float64(y / a); elseif (z <= -8.4e+15) tmp = t_1; elseif (z <= -6.6e-7) tmp = Float64(y / a); elseif (z <= 4.6e-12) tmp = Float64(x / t); elseif (z <= 5.5e+81) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (-z / t); tmp = 0.0; if (z <= -3.8e+117) tmp = y / a; elseif (z <= -8.4e+15) tmp = t_1; elseif (z <= -6.6e-7) tmp = y / a; elseif (z <= 4.6e-12) tmp = x / t; elseif (z <= 5.5e+81) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+117], N[(y / a), $MachinePrecision], If[LessEqual[z, -8.4e+15], t$95$1, If[LessEqual[z, -6.6e-7], N[(y / a), $MachinePrecision], If[LessEqual[z, 4.6e-12], N[(x / t), $MachinePrecision], If[LessEqual[z, 5.5e+81], t$95$1, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{-z}{t}\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+117}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -8.4 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-7}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.8000000000000002e117 or -8.4e15 < z < -6.6000000000000003e-7 or 5.5000000000000003e81 < z Initial program 61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in z around inf 61.5%
if -3.8000000000000002e117 < z < -8.4e15 or 4.59999999999999979e-12 < z < 5.5000000000000003e81Initial program 88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in x around 0 50.5%
associate-*r/50.5%
sub-neg50.5%
mul-1-neg50.5%
+-commutative50.5%
mul-1-neg50.5%
distribute-rgt-neg-in50.5%
fma-undefine50.5%
associate-*r/50.5%
neg-mul-150.5%
distribute-neg-frac250.5%
neg-sub050.5%
fma-undefine50.5%
distribute-rgt-neg-in50.5%
distribute-lft-neg-in50.5%
*-commutative50.5%
associate--r+50.5%
neg-sub050.5%
distribute-rgt-neg-out50.5%
remove-double-neg50.5%
Simplified50.5%
Taylor expanded in z around 0 37.2%
mul-1-neg37.2%
associate-/l*42.9%
distribute-rgt-neg-in42.9%
Simplified42.9%
if -6.6000000000000003e-7 < z < 4.59999999999999979e-12Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 58.4%
Final simplification56.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.5e+117)
(/ y a)
(if (<= z -3.3e+16)
(* y (/ (- z) t))
(if (<= z -4.4e-8)
(/ y a)
(if (<= z 1.15e-10)
(/ x t)
(if (<= z 1.9e+91) (* z (/ (- y) t)) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+117) {
tmp = y / a;
} else if (z <= -3.3e+16) {
tmp = y * (-z / t);
} else if (z <= -4.4e-8) {
tmp = y / a;
} else if (z <= 1.15e-10) {
tmp = x / t;
} else if (z <= 1.9e+91) {
tmp = 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 (z <= (-5.5d+117)) then
tmp = y / a
else if (z <= (-3.3d+16)) then
tmp = y * (-z / t)
else if (z <= (-4.4d-8)) then
tmp = y / a
else if (z <= 1.15d-10) then
tmp = x / t
else if (z <= 1.9d+91) then
tmp = 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 (z <= -5.5e+117) {
tmp = y / a;
} else if (z <= -3.3e+16) {
tmp = y * (-z / t);
} else if (z <= -4.4e-8) {
tmp = y / a;
} else if (z <= 1.15e-10) {
tmp = x / t;
} else if (z <= 1.9e+91) {
tmp = z * (-y / t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+117: tmp = y / a elif z <= -3.3e+16: tmp = y * (-z / t) elif z <= -4.4e-8: tmp = y / a elif z <= 1.15e-10: tmp = x / t elif z <= 1.9e+91: tmp = z * (-y / t) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+117) tmp = Float64(y / a); elseif (z <= -3.3e+16) tmp = Float64(y * Float64(Float64(-z) / t)); elseif (z <= -4.4e-8) tmp = Float64(y / a); elseif (z <= 1.15e-10) tmp = Float64(x / t); elseif (z <= 1.9e+91) tmp = Float64(z * Float64(Float64(-y) / t)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e+117) tmp = y / a; elseif (z <= -3.3e+16) tmp = y * (-z / t); elseif (z <= -4.4e-8) tmp = y / a; elseif (z <= 1.15e-10) tmp = x / t; elseif (z <= 1.9e+91) tmp = z * (-y / t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+117], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.3e+16], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.4e-8], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.15e-10], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.9e+91], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+117}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{+16}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-8}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-10}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+91}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.49999999999999965e117 or -3.3e16 < z < -4.3999999999999997e-8 or 1.8999999999999999e91 < z Initial program 61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in z around inf 61.5%
if -5.49999999999999965e117 < z < -3.3e16Initial program 83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in x around 0 55.3%
associate-*r/55.3%
sub-neg55.3%
mul-1-neg55.3%
+-commutative55.3%
mul-1-neg55.3%
distribute-rgt-neg-in55.3%
fma-undefine55.3%
associate-*r/55.3%
neg-mul-155.3%
distribute-neg-frac255.3%
neg-sub055.3%
fma-undefine55.3%
distribute-rgt-neg-in55.3%
distribute-lft-neg-in55.3%
*-commutative55.3%
associate--r+55.3%
neg-sub055.3%
distribute-rgt-neg-out55.3%
remove-double-neg55.3%
Simplified55.3%
Taylor expanded in z around 0 42.3%
mul-1-neg42.3%
associate-/l*46.6%
distribute-rgt-neg-in46.6%
Simplified46.6%
if -4.3999999999999997e-8 < z < 1.15000000000000004e-10Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 58.4%
if 1.15000000000000004e-10 < z < 1.8999999999999999e91Initial program 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in x around 0 46.4%
associate-*r/46.4%
sub-neg46.4%
mul-1-neg46.4%
+-commutative46.4%
mul-1-neg46.4%
distribute-rgt-neg-in46.4%
fma-undefine46.4%
associate-*r/46.4%
neg-mul-146.4%
distribute-neg-frac246.4%
neg-sub046.4%
fma-undefine46.4%
distribute-rgt-neg-in46.4%
distribute-lft-neg-in46.4%
*-commutative46.4%
associate--r+46.4%
neg-sub046.4%
distribute-rgt-neg-out46.4%
remove-double-neg46.4%
Simplified46.4%
*-commutative46.4%
associate-/l*50.0%
fma-neg50.0%
Applied egg-rr50.0%
Taylor expanded in z around 0 39.8%
associate-*r/39.8%
neg-mul-139.8%
Simplified39.8%
Final simplification56.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)) (t_2 (/ (- x (* y z)) t)))
(if (<= t -1.25e-29)
t_2
(if (<= t 3.05e-93)
t_1
(if (<= t 1.42e+23) (/ x (- t (* z a))) (if (<= t 1.3e+78) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double t_2 = (x - (y * z)) / t;
double tmp;
if (t <= -1.25e-29) {
tmp = t_2;
} else if (t <= 3.05e-93) {
tmp = t_1;
} else if (t <= 1.42e+23) {
tmp = x / (t - (z * a));
} else if (t <= 1.3e+78) {
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 = (y - (x / z)) / a
t_2 = (x - (y * z)) / t
if (t <= (-1.25d-29)) then
tmp = t_2
else if (t <= 3.05d-93) then
tmp = t_1
else if (t <= 1.42d+23) then
tmp = x / (t - (z * a))
else if (t <= 1.3d+78) 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 = (y - (x / z)) / a;
double t_2 = (x - (y * z)) / t;
double tmp;
if (t <= -1.25e-29) {
tmp = t_2;
} else if (t <= 3.05e-93) {
tmp = t_1;
} else if (t <= 1.42e+23) {
tmp = x / (t - (z * a));
} else if (t <= 1.3e+78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a t_2 = (x - (y * z)) / t tmp = 0 if t <= -1.25e-29: tmp = t_2 elif t <= 3.05e-93: tmp = t_1 elif t <= 1.42e+23: tmp = x / (t - (z * a)) elif t <= 1.3e+78: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) t_2 = Float64(Float64(x - Float64(y * z)) / t) tmp = 0.0 if (t <= -1.25e-29) tmp = t_2; elseif (t <= 3.05e-93) tmp = t_1; elseif (t <= 1.42e+23) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (t <= 1.3e+78) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; t_2 = (x - (y * z)) / t; tmp = 0.0; if (t <= -1.25e-29) tmp = t_2; elseif (t <= 3.05e-93) tmp = t_1; elseif (t <= 1.42e+23) tmp = x / (t - (z * a)); elseif (t <= 1.3e+78) tmp = t_1; else tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -1.25e-29], t$95$2, If[LessEqual[t, 3.05e-93], t$95$1, If[LessEqual[t, 1.42e+23], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+78], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
t_2 := \frac{x - y \cdot z}{t}\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{-29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.05 \cdot 10^{-93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.42 \cdot 10^{+23}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.24999999999999996e-29 or 1.3e78 < t Initial program 85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 72.4%
if -1.24999999999999996e-29 < t < 3.04999999999999985e-93 or 1.42000000000000004e23 < t < 1.3e78Initial program 82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in x around 0 81.5%
fma-define81.5%
associate-/l*89.3%
cancel-sign-sub-inv89.3%
*-commutative89.3%
+-commutative89.3%
fma-define89.3%
cancel-sign-sub-inv89.3%
*-commutative89.3%
+-commutative89.3%
fma-define89.3%
Simplified89.3%
Taylor expanded in a around inf 74.8%
mul-1-neg74.8%
unsub-neg74.8%
Simplified74.8%
if 3.04999999999999985e-93 < t < 1.42000000000000004e23Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in x around inf 72.6%
Final simplification73.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= t -2.6e-29)
(- (/ x t) (* y (/ z t)))
(if (<= t 2.9e-82)
t_1
(if (<= t 8.4e+24)
(/ x (- t (* z a)))
(if (<= t 9e+79) t_1 (/ (- x (* y z)) t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (t <= -2.6e-29) {
tmp = (x / t) - (y * (z / t));
} else if (t <= 2.9e-82) {
tmp = t_1;
} else if (t <= 8.4e+24) {
tmp = x / (t - (z * a));
} else if (t <= 9e+79) {
tmp = t_1;
} else {
tmp = (x - (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) :: t_1
real(8) :: tmp
t_1 = (y - (x / z)) / a
if (t <= (-2.6d-29)) then
tmp = (x / t) - (y * (z / t))
else if (t <= 2.9d-82) then
tmp = t_1
else if (t <= 8.4d+24) then
tmp = x / (t - (z * a))
else if (t <= 9d+79) then
tmp = t_1
else
tmp = (x - (y * z)) / t
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 (t <= -2.6e-29) {
tmp = (x / t) - (y * (z / t));
} else if (t <= 2.9e-82) {
tmp = t_1;
} else if (t <= 8.4e+24) {
tmp = x / (t - (z * a));
} else if (t <= 9e+79) {
tmp = t_1;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if t <= -2.6e-29: tmp = (x / t) - (y * (z / t)) elif t <= 2.9e-82: tmp = t_1 elif t <= 8.4e+24: tmp = x / (t - (z * a)) elif t <= 9e+79: tmp = t_1 else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (t <= -2.6e-29) tmp = Float64(Float64(x / t) - Float64(y * Float64(z / t))); elseif (t <= 2.9e-82) tmp = t_1; elseif (t <= 8.4e+24) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (t <= 9e+79) tmp = t_1; else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; tmp = 0.0; if (t <= -2.6e-29) tmp = (x / t) - (y * (z / t)); elseif (t <= 2.9e-82) tmp = t_1; elseif (t <= 8.4e+24) tmp = x / (t - (z * a)); elseif (t <= 9e+79) tmp = t_1; else tmp = (x - (y * z)) / t; 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[t, -2.6e-29], N[(N[(x / t), $MachinePrecision] - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e-82], t$95$1, If[LessEqual[t, 8.4e+24], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+79], t$95$1, N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{-29}:\\
\;\;\;\;\frac{x}{t} - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+24}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if t < -2.6000000000000002e-29Initial program 84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in x around 0 84.8%
fma-define84.8%
associate-/l*95.2%
cancel-sign-sub-inv95.2%
*-commutative95.2%
+-commutative95.2%
fma-define95.2%
cancel-sign-sub-inv95.2%
*-commutative95.2%
+-commutative95.2%
fma-define95.3%
Simplified95.3%
Taylor expanded in a around 0 61.2%
+-commutative61.2%
mul-1-neg61.2%
sub-neg61.2%
*-commutative61.2%
div-sub61.2%
Simplified61.2%
div-sub61.2%
*-commutative61.2%
associate-/l*67.3%
Applied egg-rr67.3%
if -2.6000000000000002e-29 < t < 2.89999999999999977e-82 or 8.4000000000000005e24 < t < 8.99999999999999987e79Initial program 82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in x around 0 81.5%
fma-define81.5%
associate-/l*89.3%
cancel-sign-sub-inv89.3%
*-commutative89.3%
+-commutative89.3%
fma-define89.3%
cancel-sign-sub-inv89.3%
*-commutative89.3%
+-commutative89.3%
fma-define89.3%
Simplified89.3%
Taylor expanded in a around inf 74.8%
mul-1-neg74.8%
unsub-neg74.8%
Simplified74.8%
if 2.89999999999999977e-82 < t < 8.4000000000000005e24Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in x around inf 72.6%
if 8.99999999999999987e79 < t Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 84.5%
Final simplification75.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.4e+142) (not (<= z 4.8e+79))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.4e+142) || !(z <= 4.8e+79)) {
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.4d+142)) .or. (.not. (z <= 4.8d+79))) 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.4e+142) || !(z <= 4.8e+79)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.4e+142) or not (z <= 4.8e+79): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.4e+142) || !(z <= 4.8e+79)) 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.4e+142) || ~((z <= 4.8e+79))) 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.4e+142], N[Not[LessEqual[z, 4.8e+79]], $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.4 \cdot 10^{+142} \lor \neg \left(z \leq 4.8 \cdot 10^{+79}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -4.39999999999999974e142 or 4.79999999999999971e79 < z Initial program 56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in z around inf 62.7%
if -4.39999999999999974e142 < z < 4.79999999999999971e79Initial program 96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in x around inf 67.6%
Final simplification66.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8e-9) (not (<= z 1.4e+80))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e-9) || !(z <= 1.4e+80)) {
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 <= (-8d-9)) .or. (.not. (z <= 1.4d+80))) 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 <= -8e-9) || !(z <= 1.4e+80)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8e-9) or not (z <= 1.4e+80): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8e-9) || !(z <= 1.4e+80)) 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 <= -8e-9) || ~((z <= 1.4e+80))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8e-9], N[Not[LessEqual[z, 1.4e+80]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-9} \lor \neg \left(z \leq 1.4 \cdot 10^{+80}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -8.0000000000000005e-9 or 1.39999999999999992e80 < z Initial program 65.3%
*-commutative65.3%
Simplified65.3%
Taylor expanded in z around inf 52.6%
if -8.0000000000000005e-9 < z < 1.39999999999999992e80Initial program 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in z around 0 52.2%
Final simplification52.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 84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in z around 0 36.0%
Final simplification36.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
(if (< z -32113435955957344.0)
t_2
(if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (a * z)
t_2 = (x / t_1) - (y / ((t / z) - a))
if (z < (-32113435955957344.0d0)) then
tmp = t_2
else if (z < 3.5139522372978296d-86) then
tmp = (x - (y * z)) * (1.0d0 / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) t_2 = (x / t_1) - (y / ((t / z) - a)) tmp = 0 if z < -32113435955957344.0: tmp = t_2 elif z < 3.5139522372978296e-86: tmp = (x - (y * z)) * (1.0 / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))) tmp = 0.0 if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); t_2 = (x / t_1) - (y / ((t / z) - a)); tmp = 0.0; if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = (x - (y * z)) * (1.0 / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024041
(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))))