
(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 13 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 (- t (* z a)))
(t_4 (/ (- x (* y z)) t_3)))
(if (<= t_4 -2.8e-10)
t_2
(if (<= t_4 4e+23)
(+ (/ x t_3) (/ (* y z) (- (* z a) t)))
(if (<= t_4 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 = t - (z * a);
double t_4 = (x - (y * z)) / t_3;
double tmp;
if (t_4 <= -2.8e-10) {
tmp = t_2;
} else if (t_4 <= 4e+23) {
tmp = (x / t_3) + ((y * z) / ((z * a) - t));
} else if (t_4 <= ((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(t - Float64(z * a)) t_4 = Float64(Float64(x - Float64(y * z)) / t_3) tmp = 0.0 if (t_4 <= -2.8e-10) tmp = t_2; elseif (t_4 <= 4e+23) tmp = Float64(Float64(x / t_3) + Float64(Float64(y * z) / Float64(Float64(z * a) - t))); elseif (t_4 <= 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[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[t$95$4, -2.8e-10], t$95$2, If[LessEqual[t$95$4, 4e+23], N[(N[(x / t$95$3), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 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 := t - z \cdot a\\
t_4 := \frac{x - y \cdot z}{t\_3}\\
\mathbf{if}\;t\_4 \leq -2.8 \cdot 10^{-10}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+23}:\\
\;\;\;\;\frac{x}{t\_3} + \frac{y \cdot z}{z \cdot a - t}\\
\mathbf{elif}\;t\_4 \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))) < -2.80000000000000015e-10 or 3.9999999999999997e23 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in x around 0 85.6%
fma-define85.6%
associate-/l*99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
Simplified99.7%
if -2.80000000000000015e-10 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 3.9999999999999997e23Initial program 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in x around 0 91.7%
fma-define91.7%
associate-/l*85.9%
cancel-sign-sub-inv85.9%
*-commutative85.9%
+-commutative85.9%
fma-define85.9%
cancel-sign-sub-inv85.9%
*-commutative85.9%
+-commutative85.9%
fma-define85.9%
Simplified85.9%
Taylor expanded in y around 0 91.7%
+-commutative91.7%
mul-1-neg91.7%
unsub-neg91.7%
mul-1-neg91.7%
sub-neg91.7%
*-commutative91.7%
associate-/l*85.9%
mul-1-neg85.9%
sub-neg85.9%
*-commutative85.9%
Simplified85.9%
clear-num85.3%
inv-pow85.3%
Applied egg-rr85.3%
unpow-185.3%
Simplified85.3%
Taylor expanded in y around 0 91.7%
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.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a)))
(t_2 (+ (/ x t_1) (* y (/ z (- (* z a) t)))))
(t_3 (/ (- x (* y z)) t_1)))
(if (<= t_3 -2.8e-10)
t_2
(if (<= t_3 5e-58) 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 = t - (z * a);
double t_2 = (x / t_1) + (y * (z / ((z * a) - t)));
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -2.8e-10) {
tmp = t_2;
} else if (t_3 <= 5e-58) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x / t_1) + (y * (z / ((z * a) - t)));
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -2.8e-10) {
tmp = t_2;
} else if (t_3 <= 5e-58) {
tmp = t_3;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (x / t_1) + (y * (z / ((z * a) - t))) t_3 = (x - (y * z)) / t_1 tmp = 0 if t_3 <= -2.8e-10: tmp = t_2 elif t_3 <= 5e-58: tmp = t_3 elif t_3 <= math.inf: tmp = t_2 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(x / t_1) + Float64(y * Float64(z / Float64(Float64(z * a) - t)))) t_3 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_3 <= -2.8e-10) tmp = t_2; elseif (t_3 <= 5e-58) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (x / t_1) + (y * (z / ((z * a) - t))); t_3 = (x - (y * z)) / t_1; tmp = 0.0; if (t_3 <= -2.8e-10) tmp = t_2; elseif (t_3 <= 5e-58) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] + N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -2.8e-10], t$95$2, If[LessEqual[t$95$3, 5e-58], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x}{t\_1} + y \cdot \frac{z}{z \cdot a - t}\\
t_3 := \frac{x - y \cdot z}{t\_1}\\
\mathbf{if}\;t\_3 \leq -2.8 \cdot 10^{-10}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-58}:\\
\;\;\;\;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))) < -2.80000000000000015e-10 or 4.99999999999999977e-58 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in x around 0 87.3%
fma-define87.3%
associate-/l*99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in y around 0 87.3%
+-commutative87.3%
mul-1-neg87.3%
unsub-neg87.3%
mul-1-neg87.3%
sub-neg87.3%
*-commutative87.3%
associate-/l*99.7%
mul-1-neg99.7%
sub-neg99.7%
*-commutative99.7%
Simplified99.7%
if -2.80000000000000015e-10 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.99999999999999977e-58Initial program 90.5%
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.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t))
(t_2 (- t (* z a)))
(t_3 (/ x t_2))
(t_4 (+ t_3 (* y (/ z t_1))))
(t_5 (/ (- x (* y z)) t_2)))
(if (<= t_5 -2.8e-10)
t_4
(if (<= t_5 5e-58)
(+ t_3 (/ (* y z) t_1))
(if (<= t_5 INFINITY) t_4 (/ 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 / t_2;
double t_4 = t_3 + (y * (z / t_1));
double t_5 = (x - (y * z)) / t_2;
double tmp;
if (t_5 <= -2.8e-10) {
tmp = t_4;
} else if (t_5 <= 5e-58) {
tmp = t_3 + ((y * z) / t_1);
} else if (t_5 <= ((double) INFINITY)) {
tmp = t_4;
} 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 / t_2;
double t_4 = t_3 + (y * (z / t_1));
double t_5 = (x - (y * z)) / t_2;
double tmp;
if (t_5 <= -2.8e-10) {
tmp = t_4;
} else if (t_5 <= 5e-58) {
tmp = t_3 + ((y * z) / t_1);
} else if (t_5 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} 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 / t_2 t_4 = t_3 + (y * (z / t_1)) t_5 = (x - (y * z)) / t_2 tmp = 0 if t_5 <= -2.8e-10: tmp = t_4 elif t_5 <= 5e-58: tmp = t_3 + ((y * z) / t_1) elif t_5 <= math.inf: tmp = t_4 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(x / t_2) t_4 = Float64(t_3 + Float64(y * Float64(z / t_1))) t_5 = Float64(Float64(x - Float64(y * z)) / t_2) tmp = 0.0 if (t_5 <= -2.8e-10) tmp = t_4; elseif (t_5 <= 5e-58) tmp = Float64(t_3 + Float64(Float64(y * z) / t_1)); elseif (t_5 <= Inf) tmp = t_4; 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 / t_2; t_4 = t_3 + (y * (z / t_1)); t_5 = (x - (y * z)) / t_2; tmp = 0.0; if (t_5 <= -2.8e-10) tmp = t_4; elseif (t_5 <= 5e-58) tmp = t_3 + ((y * z) / t_1); elseif (t_5 <= Inf) tmp = t_4; 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[(x / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$5, -2.8e-10], t$95$4, If[LessEqual[t$95$5, 5e-58], N[(t$95$3 + N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], t$95$4, 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}{t\_2}\\
t_4 := t\_3 + y \cdot \frac{z}{t\_1}\\
t_5 := \frac{x - y \cdot z}{t\_2}\\
\mathbf{if}\;t\_5 \leq -2.8 \cdot 10^{-10}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_5 \leq 5 \cdot 10^{-58}:\\
\;\;\;\;t\_3 + \frac{y \cdot z}{t\_1}\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -2.80000000000000015e-10 or 4.99999999999999977e-58 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in x around 0 87.3%
fma-define87.3%
associate-/l*99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in y around 0 87.3%
+-commutative87.3%
mul-1-neg87.3%
unsub-neg87.3%
mul-1-neg87.3%
sub-neg87.3%
*-commutative87.3%
associate-/l*99.7%
mul-1-neg99.7%
sub-neg99.7%
*-commutative99.7%
Simplified99.7%
if -2.80000000000000015e-10 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.99999999999999977e-58Initial program 90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in x around 0 90.6%
fma-define90.6%
associate-/l*83.9%
cancel-sign-sub-inv83.9%
*-commutative83.9%
+-commutative83.9%
fma-define83.9%
cancel-sign-sub-inv83.9%
*-commutative83.9%
+-commutative83.9%
fma-define83.9%
Simplified83.9%
Taylor expanded in y around 0 90.6%
+-commutative90.6%
mul-1-neg90.6%
unsub-neg90.6%
mul-1-neg90.6%
sub-neg90.6%
*-commutative90.6%
associate-/l*83.9%
mul-1-neg83.9%
sub-neg83.9%
*-commutative83.9%
Simplified83.9%
clear-num83.2%
inv-pow83.2%
Applied egg-rr83.2%
unpow-183.2%
Simplified83.2%
Taylor expanded in y around 0 90.6%
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.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_1 (- INFINITY))
(* y (/ z (- (* z a) t)))
(if (<= t_1 2e+305) t_1 (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (z / ((z * a) - t));
} else if (t_1 <= 2e+305) {
tmp = 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 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (z / ((z * a) - t));
} else if (t_1 <= 2e+305) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / (t - (z * a)) tmp = 0 if t_1 <= -math.inf: tmp = y * (z / ((z * a) - t)) elif t_1 <= 2e+305: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(z / Float64(Float64(z * a) - t))); elseif (t_1 <= 2e+305) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (y * z)) / (t - (z * a)); tmp = 0.0; if (t_1 <= -Inf) tmp = y * (z / ((z * a) - t)); elseif (t_1 <= 2e+305) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+305], t$95$1, N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{z \cdot a - t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;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 47.2%
*-commutative47.2%
Simplified47.2%
Taylor expanded in x around 0 47.2%
fma-define47.2%
associate-/l*99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in y around inf 19.8%
mul-1-neg19.8%
associate-/l*72.3%
distribute-rgt-neg-in72.3%
mul-1-neg72.3%
sub-neg72.3%
*-commutative72.3%
Simplified72.3%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.9999999999999999e305Initial program 95.0%
if 1.9999999999999999e305 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 29.9%
*-commutative29.9%
Simplified29.9%
Taylor expanded in z around inf 84.6%
Final simplification92.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_1 (- INFINITY))
(- (/ x t) (* y (/ -1.0 (/ (- (* z a) t) z))))
(if (<= t_1 2e+305) t_1 (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / t) - (y * (-1.0 / (((z * a) - t) / z)));
} else if (t_1 <= 2e+305) {
tmp = 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 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x / t) - (y * (-1.0 / (((z * a) - t) / z)));
} else if (t_1 <= 2e+305) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / (t - (z * a)) tmp = 0 if t_1 <= -math.inf: tmp = (x / t) - (y * (-1.0 / (((z * a) - t) / z))) elif t_1 <= 2e+305: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x / t) - Float64(y * Float64(-1.0 / Float64(Float64(Float64(z * a) - t) / z)))); elseif (t_1 <= 2e+305) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (y * z)) / (t - (z * a)); tmp = 0.0; if (t_1 <= -Inf) tmp = (x / t) - (y * (-1.0 / (((z * a) - t) / z))); elseif (t_1 <= 2e+305) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x / t), $MachinePrecision] - N[(y * N[(-1.0 / N[(N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+305], t$95$1, N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x}{t} - y \cdot \frac{-1}{\frac{z \cdot a - t}{z}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;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 47.2%
*-commutative47.2%
Simplified47.2%
Taylor expanded in x around 0 47.2%
fma-define47.2%
associate-/l*99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in y around 0 47.2%
+-commutative47.2%
mul-1-neg47.2%
unsub-neg47.2%
mul-1-neg47.2%
sub-neg47.2%
*-commutative47.2%
associate-/l*99.7%
mul-1-neg99.7%
sub-neg99.7%
*-commutative99.7%
Simplified99.7%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
unpow-199.7%
Simplified99.7%
Taylor expanded in t around inf 72.7%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.9999999999999999e305Initial program 95.0%
if 1.9999999999999999e305 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 29.9%
*-commutative29.9%
Simplified29.9%
Taylor expanded in z around inf 84.6%
Final simplification92.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ (- y) t))))
(if (<= z -6.2e+87)
(/ y a)
(if (<= z -1.18e+27)
t_1
(if (<= z -9.5e-18)
(/ y a)
(if (<= z 1e-73) (/ x t) (if (<= z 2e+82) t_1 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (-y / t);
double tmp;
if (z <= -6.2e+87) {
tmp = y / a;
} else if (z <= -1.18e+27) {
tmp = t_1;
} else if (z <= -9.5e-18) {
tmp = y / a;
} else if (z <= 1e-73) {
tmp = x / t;
} else if (z <= 2e+82) {
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 = z * (-y / t)
if (z <= (-6.2d+87)) then
tmp = y / a
else if (z <= (-1.18d+27)) then
tmp = t_1
else if (z <= (-9.5d-18)) then
tmp = y / a
else if (z <= 1d-73) then
tmp = x / t
else if (z <= 2d+82) 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 = z * (-y / t);
double tmp;
if (z <= -6.2e+87) {
tmp = y / a;
} else if (z <= -1.18e+27) {
tmp = t_1;
} else if (z <= -9.5e-18) {
tmp = y / a;
} else if (z <= 1e-73) {
tmp = x / t;
} else if (z <= 2e+82) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (-y / t) tmp = 0 if z <= -6.2e+87: tmp = y / a elif z <= -1.18e+27: tmp = t_1 elif z <= -9.5e-18: tmp = y / a elif z <= 1e-73: tmp = x / t elif z <= 2e+82: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(Float64(-y) / t)) tmp = 0.0 if (z <= -6.2e+87) tmp = Float64(y / a); elseif (z <= -1.18e+27) tmp = t_1; elseif (z <= -9.5e-18) tmp = Float64(y / a); elseif (z <= 1e-73) tmp = Float64(x / t); elseif (z <= 2e+82) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (-y / t); tmp = 0.0; if (z <= -6.2e+87) tmp = y / a; elseif (z <= -1.18e+27) tmp = t_1; elseif (z <= -9.5e-18) tmp = y / a; elseif (z <= 1e-73) tmp = x / t; elseif (z <= 2e+82) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e+87], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.18e+27], t$95$1, If[LessEqual[z, -9.5e-18], N[(y / a), $MachinePrecision], If[LessEqual[z, 1e-73], N[(x / t), $MachinePrecision], If[LessEqual[z, 2e+82], t$95$1, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{-y}{t}\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+87}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.18 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 10^{-73}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.1999999999999999e87 or -1.18000000000000006e27 < z < -9.5000000000000003e-18 or 1.9999999999999999e82 < z Initial program 67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in z around inf 58.1%
if -6.1999999999999999e87 < z < -1.18000000000000006e27 or 9.99999999999999997e-74 < z < 1.9999999999999999e82Initial program 95.4%
*-commutative95.4%
Simplified95.4%
clear-num95.3%
associate-/r/95.1%
sub-neg95.1%
+-commutative95.1%
*-commutative95.1%
distribute-rgt-neg-in95.1%
fma-define95.1%
Applied egg-rr95.1%
Taylor expanded in a around 0 47.1%
Taylor expanded in x around 0 39.3%
mul-1-neg39.3%
*-commutative39.3%
associate-/l*45.6%
distribute-lft-neg-in45.6%
Simplified45.6%
if -9.5000000000000003e-18 < z < 9.99999999999999997e-74Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 54.9%
Final simplification54.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) t)) (t_2 (/ (- y (/ x z)) a)))
(if (<= a -5e+18)
t_2
(if (<= a -2.5e-34)
t_1
(if (<= a -5.3e-45)
t_2
(if (<= a 1.52e-46) t_1 (- (/ y a) (/ (/ x a) z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (a <= -5e+18) {
tmp = t_2;
} else if (a <= -2.5e-34) {
tmp = t_1;
} else if (a <= -5.3e-45) {
tmp = t_2;
} else if (a <= 1.52e-46) {
tmp = t_1;
} else {
tmp = (y / a) - ((x / a) / z);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x - (y * z)) / t
t_2 = (y - (x / z)) / a
if (a <= (-5d+18)) then
tmp = t_2
else if (a <= (-2.5d-34)) then
tmp = t_1
else if (a <= (-5.3d-45)) then
tmp = t_2
else if (a <= 1.52d-46) then
tmp = t_1
else
tmp = (y / a) - ((x / a) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (a <= -5e+18) {
tmp = t_2;
} else if (a <= -2.5e-34) {
tmp = t_1;
} else if (a <= -5.3e-45) {
tmp = t_2;
} else if (a <= 1.52e-46) {
tmp = t_1;
} else {
tmp = (y / a) - ((x / a) / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / t t_2 = (y - (x / z)) / a tmp = 0 if a <= -5e+18: tmp = t_2 elif a <= -2.5e-34: tmp = t_1 elif a <= -5.3e-45: tmp = t_2 elif a <= 1.52e-46: tmp = t_1 else: tmp = (y / a) - ((x / a) / z) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / t) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (a <= -5e+18) tmp = t_2; elseif (a <= -2.5e-34) tmp = t_1; elseif (a <= -5.3e-45) tmp = t_2; elseif (a <= 1.52e-46) tmp = t_1; else tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (y * z)) / t; t_2 = (y - (x / z)) / a; tmp = 0.0; if (a <= -5e+18) tmp = t_2; elseif (a <= -2.5e-34) tmp = t_1; elseif (a <= -5.3e-45) tmp = t_2; elseif (a <= 1.52e-46) tmp = t_1; else tmp = (y / a) - ((x / a) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -5e+18], t$95$2, If[LessEqual[a, -2.5e-34], t$95$1, If[LessEqual[a, -5.3e-45], t$95$2, If[LessEqual[a, 1.52e-46], t$95$1, N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;a \leq -5 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -2.5 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -5.3 \cdot 10^{-45}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 1.52 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\end{array}
\end{array}
if a < -5e18 or -2.5000000000000001e-34 < a < -5.2999999999999997e-45Initial program 75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in x around 0 75.2%
fma-define75.2%
associate-/l*83.4%
cancel-sign-sub-inv83.4%
*-commutative83.4%
+-commutative83.4%
fma-define83.5%
cancel-sign-sub-inv83.5%
*-commutative83.5%
+-commutative83.5%
fma-define83.5%
Simplified83.5%
Taylor expanded in a around inf 80.1%
mul-1-neg80.1%
unsub-neg80.1%
Simplified80.1%
if -5e18 < a < -2.5000000000000001e-34 or -5.2999999999999997e-45 < a < 1.52000000000000006e-46Initial program 95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in t around inf 79.6%
if 1.52000000000000006e-46 < a Initial program 76.8%
*-commutative76.8%
Simplified76.8%
Taylor expanded in t around 0 58.6%
associate-*r/58.6%
neg-mul-158.6%
neg-sub058.6%
sub-neg58.6%
distribute-rgt-neg-out58.6%
+-commutative58.6%
associate--r+58.6%
neg-sub058.6%
distribute-rgt-neg-out58.6%
remove-double-neg58.6%
*-commutative58.6%
Simplified58.6%
clear-num58.5%
inv-pow58.5%
*-commutative58.5%
fma-neg58.5%
Applied egg-rr58.5%
unpow-158.5%
fma-neg58.5%
Simplified58.5%
Taylor expanded in z around 0 75.5%
+-commutative75.5%
mul-1-neg75.5%
unsub-neg75.5%
associate-/r*76.0%
Simplified76.0%
Final simplification78.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= a -3.8e+263)
(/ y a)
(if (<= a -2.95e+103)
t_1
(if (<= a -3900000000000.0)
(/ y a)
(if (<= a 6.5e-53) (/ (- x (* y z)) t) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (a <= -3.8e+263) {
tmp = y / a;
} else if (a <= -2.95e+103) {
tmp = t_1;
} else if (a <= -3900000000000.0) {
tmp = y / a;
} else if (a <= 6.5e-53) {
tmp = (x - (y * z)) / t;
} 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 = x / (t - (z * a))
if (a <= (-3.8d+263)) then
tmp = y / a
else if (a <= (-2.95d+103)) then
tmp = t_1
else if (a <= (-3900000000000.0d0)) then
tmp = y / a
else if (a <= 6.5d-53) then
tmp = (x - (y * z)) / t
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 = x / (t - (z * a));
double tmp;
if (a <= -3.8e+263) {
tmp = y / a;
} else if (a <= -2.95e+103) {
tmp = t_1;
} else if (a <= -3900000000000.0) {
tmp = y / a;
} else if (a <= 6.5e-53) {
tmp = (x - (y * z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if a <= -3.8e+263: tmp = y / a elif a <= -2.95e+103: tmp = t_1 elif a <= -3900000000000.0: tmp = y / a elif a <= 6.5e-53: tmp = (x - (y * z)) / t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (a <= -3.8e+263) tmp = Float64(y / a); elseif (a <= -2.95e+103) tmp = t_1; elseif (a <= -3900000000000.0) tmp = Float64(y / a); elseif (a <= 6.5e-53) tmp = Float64(Float64(x - Float64(y * z)) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (a <= -3.8e+263) tmp = y / a; elseif (a <= -2.95e+103) tmp = t_1; elseif (a <= -3900000000000.0) tmp = y / a; elseif (a <= 6.5e-53) tmp = (x - (y * z)) / t; else tmp = t_1; 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[a, -3.8e+263], N[(y / a), $MachinePrecision], If[LessEqual[a, -2.95e+103], t$95$1, If[LessEqual[a, -3900000000000.0], N[(y / a), $MachinePrecision], If[LessEqual[a, 6.5e-53], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{+263}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;a \leq -2.95 \cdot 10^{+103}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3900000000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-53}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.7999999999999999e263 or -2.9499999999999999e103 < a < -3.9e12Initial program 62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in z around inf 78.2%
if -3.7999999999999999e263 < a < -2.9499999999999999e103 or 6.4999999999999997e-53 < a Initial program 79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in x around inf 58.4%
if -3.9e12 < a < 6.4999999999999997e-53Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in t around inf 76.3%
Final simplification69.3%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.02e+27)
(/ y a)
(if (<= y 1.3e+89)
(/ x (- t (* z a)))
(if (<= y 1.55e+129)
(/ (* y z) (- t))
(if (<= y 2.5e+207) (/ y a) (* z (/ (- y) t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.02e+27) {
tmp = y / a;
} else if (y <= 1.3e+89) {
tmp = x / (t - (z * a));
} else if (y <= 1.55e+129) {
tmp = (y * z) / -t;
} else if (y <= 2.5e+207) {
tmp = y / a;
} else {
tmp = z * (-y / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-1.02d+27)) then
tmp = y / a
else if (y <= 1.3d+89) then
tmp = x / (t - (z * a))
else if (y <= 1.55d+129) then
tmp = (y * z) / -t
else if (y <= 2.5d+207) then
tmp = y / a
else
tmp = z * (-y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.02e+27) {
tmp = y / a;
} else if (y <= 1.3e+89) {
tmp = x / (t - (z * a));
} else if (y <= 1.55e+129) {
tmp = (y * z) / -t;
} else if (y <= 2.5e+207) {
tmp = y / a;
} else {
tmp = z * (-y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.02e+27: tmp = y / a elif y <= 1.3e+89: tmp = x / (t - (z * a)) elif y <= 1.55e+129: tmp = (y * z) / -t elif y <= 2.5e+207: tmp = y / a else: tmp = z * (-y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.02e+27) tmp = Float64(y / a); elseif (y <= 1.3e+89) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (y <= 1.55e+129) tmp = Float64(Float64(y * z) / Float64(-t)); elseif (y <= 2.5e+207) tmp = Float64(y / a); else tmp = Float64(z * Float64(Float64(-y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.02e+27) tmp = y / a; elseif (y <= 1.3e+89) tmp = x / (t - (z * a)); elseif (y <= 1.55e+129) tmp = (y * z) / -t; elseif (y <= 2.5e+207) tmp = y / a; else tmp = z * (-y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.02e+27], N[(y / a), $MachinePrecision], If[LessEqual[y, 1.3e+89], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e+129], N[(N[(y * z), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[y, 2.5e+207], N[(y / a), $MachinePrecision], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+27}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+89}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+129}:\\
\;\;\;\;\frac{y \cdot z}{-t}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+207}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\end{array}
\end{array}
if y < -1.0199999999999999e27 or 1.55e129 < y < 2.5e207Initial program 74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in z around inf 46.3%
if -1.0199999999999999e27 < y < 1.3e89Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in x around inf 72.0%
if 1.3e89 < y < 1.55e129Initial program 87.1%
*-commutative87.1%
Simplified87.1%
clear-num84.7%
associate-/r/87.0%
sub-neg87.0%
+-commutative87.0%
*-commutative87.0%
distribute-rgt-neg-in87.0%
fma-define87.0%
Applied egg-rr87.0%
Taylor expanded in a around 0 75.0%
Taylor expanded in x around 0 61.6%
associate-*r/61.6%
mul-1-neg61.6%
*-commutative61.6%
distribute-lft-neg-in61.6%
Simplified61.6%
if 2.5e207 < y Initial program 64.0%
*-commutative64.0%
Simplified64.0%
clear-num64.1%
associate-/r/64.0%
sub-neg64.0%
+-commutative64.0%
*-commutative64.0%
distribute-rgt-neg-in64.0%
fma-define64.0%
Applied egg-rr64.0%
Taylor expanded in a around 0 51.7%
Taylor expanded in x around 0 47.6%
mul-1-neg47.6%
*-commutative47.6%
associate-/l*55.7%
distribute-lft-neg-in55.7%
Simplified55.7%
Final simplification62.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.5e+55) (/ (- x (* y z)) t) (if (<= t 1.02e+52) (/ (- y (/ x z)) a) (- (/ x t) (/ (* y z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e+55) {
tmp = (x - (y * z)) / t;
} else if (t <= 1.02e+52) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - ((y * z) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2.5d+55)) then
tmp = (x - (y * z)) / t
else if (t <= 1.02d+52) then
tmp = (y - (x / z)) / a
else
tmp = (x / t) - ((y * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e+55) {
tmp = (x - (y * z)) / t;
} else if (t <= 1.02e+52) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.5e+55: tmp = (x - (y * z)) / t elif t <= 1.02e+52: tmp = (y - (x / z)) / a else: tmp = (x / t) - ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5e+55) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (t <= 1.02e+52) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x / t) - Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.5e+55) tmp = (x - (y * z)) / t; elseif (t <= 1.02e+52) tmp = (y - (x / z)) / a; else tmp = (x / t) - ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5e+55], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.02e+52], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / t), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+55}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+52}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} - \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if t < -2.50000000000000023e55Initial program 87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in t around inf 84.0%
if -2.50000000000000023e55 < t < 1.02000000000000002e52Initial program 86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in x around 0 86.5%
fma-define86.5%
associate-/l*91.0%
cancel-sign-sub-inv91.0%
*-commutative91.0%
+-commutative91.0%
fma-define91.0%
cancel-sign-sub-inv91.0%
*-commutative91.0%
+-commutative91.0%
fma-define91.0%
Simplified91.0%
Taylor expanded in a around inf 70.5%
mul-1-neg70.5%
unsub-neg70.5%
Simplified70.5%
if 1.02000000000000002e52 < t Initial program 80.0%
*-commutative80.0%
Simplified80.0%
clear-num79.8%
associate-/r/79.9%
sub-neg79.9%
+-commutative79.9%
*-commutative79.9%
distribute-rgt-neg-in79.9%
fma-define79.9%
Applied egg-rr79.9%
Taylor expanded in a around 0 67.4%
associate-*l/67.5%
*-un-lft-identity67.5%
div-sub67.6%
*-commutative67.6%
Applied egg-rr67.6%
Final simplification72.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.25e+55) (not (<= t 6.2e+51))) (/ (- x (* y z)) t) (/ (- y (/ x z)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.25e+55) || !(t <= 6.2e+51)) {
tmp = (x - (y * z)) / t;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.25d+55)) .or. (.not. (t <= 6.2d+51))) then
tmp = (x - (y * z)) / t
else
tmp = (y - (x / z)) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.25e+55) || !(t <= 6.2e+51)) {
tmp = (x - (y * z)) / t;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.25e+55) or not (t <= 6.2e+51): tmp = (x - (y * z)) / t else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.25e+55) || !(t <= 6.2e+51)) tmp = Float64(Float64(x - Float64(y * z)) / t); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.25e+55) || ~((t <= 6.2e+51))) tmp = (x - (y * z)) / t; else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.25e+55], N[Not[LessEqual[t, 6.2e+51]], $MachinePrecision]], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.25 \cdot 10^{+55} \lor \neg \left(t \leq 6.2 \cdot 10^{+51}\right):\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if t < -2.24999999999999999e55 or 6.20000000000000022e51 < t Initial program 83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in t around inf 75.0%
if -2.24999999999999999e55 < t < 6.20000000000000022e51Initial program 86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in x around 0 86.5%
fma-define86.5%
associate-/l*91.0%
cancel-sign-sub-inv91.0%
*-commutative91.0%
+-commutative91.0%
fma-define91.0%
cancel-sign-sub-inv91.0%
*-commutative91.0%
+-commutative91.0%
fma-define91.0%
Simplified91.0%
Taylor expanded in a around inf 70.5%
mul-1-neg70.5%
unsub-neg70.5%
Simplified70.5%
Final simplification72.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e-17) (not (<= z 1.06e-46))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-17) || !(z <= 1.06e-46)) {
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 <= (-1d-17)) .or. (.not. (z <= 1.06d-46))) 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 <= -1e-17) || !(z <= 1.06e-46)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e-17) or not (z <= 1.06e-46): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e-17) || !(z <= 1.06e-46)) 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 <= -1e-17) || ~((z <= 1.06e-46))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e-17], N[Not[LessEqual[z, 1.06e-46]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-17} \lor \neg \left(z \leq 1.06 \cdot 10^{-46}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -1.00000000000000007e-17 or 1.06e-46 < z Initial program 74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in z around inf 48.6%
if -1.00000000000000007e-17 < z < 1.06e-46Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 54.3%
Final simplification51.0%
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
return x / t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x / t
end function
public static double code(double x, double y, double z, double t, double a) {
return x / t;
}
def code(x, y, z, t, a): return x / t
function code(x, y, z, t, a) return Float64(x / t) end
function tmp = code(x, y, z, t, a) tmp = x / t; end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t}
\end{array}
Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in z around 0 30.1%
Final simplification30.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
(if (< z -32113435955957344.0)
t_2
(if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (a * z)
t_2 = (x / t_1) - (y / ((t / z) - a))
if (z < (-32113435955957344.0d0)) then
tmp = t_2
else if (z < 3.5139522372978296d-86) then
tmp = (x - (y * z)) * (1.0d0 / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) t_2 = (x / t_1) - (y / ((t / z) - a)) tmp = 0 if z < -32113435955957344.0: tmp = t_2 elif z < 3.5139522372978296e-86: tmp = (x - (y * z)) * (1.0 / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))) tmp = 0.0 if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); t_2 = (x / t_1) - (y / ((t / z) - a)); tmp = 0.0; if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = (x - (y * z)) * (1.0 / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024050
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(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))))