
(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 (- t (* z a)))
(t_2 (- (pow (/ (cbrt x) (cbrt t_1)) 3.0) (* y (/ z t_1))))
(t_3 (/ (- x (* y z)) t_1)))
(if (<= t_3 (- INFINITY))
t_2
(if (<= t_3 -5e-320)
t_3
(if (<= t_3 0.0)
(+ (/ y a) (* (- (/ x a) (* y (* t (pow a -2.0)))) (/ -1.0 z)))
(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 = pow((cbrt(x) / cbrt(t_1)), 3.0) - (y * (z / t_1));
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_3 <= -5e-320) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (y / a) + (((x / a) - (y * (t * pow(a, -2.0)))) * (-1.0 / z));
} 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 = Math.pow((Math.cbrt(x) / Math.cbrt(t_1)), 3.0) - (y * (z / t_1));
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_3 <= -5e-320) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (y / a) + (((x / a) - (y * (t * Math.pow(a, -2.0)))) * (-1.0 / z));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
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(cbrt(x) / cbrt(t_1)) ^ 3.0) - Float64(y * Float64(z / t_1))) t_3 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_2; elseif (t_3 <= -5e-320) tmp = t_3; elseif (t_3 <= 0.0) tmp = Float64(Float64(y / a) + Float64(Float64(Float64(x / a) - Float64(y * Float64(t * (a ^ -2.0)))) * Float64(-1.0 / z))); 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[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[N[(N[Power[x, 1/3], $MachinePrecision] / N[Power[t$95$1, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$2, If[LessEqual[t$95$3, -5e-320], t$95$3, If[LessEqual[t$95$3, 0.0], N[(N[(y / a), $MachinePrecision] + N[(N[(N[(x / a), $MachinePrecision] - N[(y * N[(t * N[Power[a, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 := {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{t_1}}\right)}^{3} - y \cdot \frac{z}{t_1}\\
t_3 := \frac{x - y \cdot z}{t_1}\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq -5 \cdot 10^{-320}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{y}{a} + \left(\frac{x}{a} - y \cdot \left(t \cdot {a}^{-2}\right)\right) \cdot \frac{-1}{z}\\
\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))) < -inf.0 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 89.6%
*-commutative89.6%
Simplified89.6%
div-sub88.9%
sub-neg88.9%
add-cube-cbrt88.1%
add-cube-cbrt88.0%
times-frac88.0%
fma-def88.7%
Applied egg-rr97.5%
fma-neg96.7%
*-commutative96.7%
Simplified96.7%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99994e-320Initial program 99.6%
if -4.99994e-320 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 48.0%
*-commutative48.0%
Simplified48.0%
Taylor expanded in z around inf 43.1%
+-commutative43.1%
associate--l+43.1%
associate-/r*79.4%
associate-*r/79.4%
associate-/r*79.4%
associate-*r/79.4%
div-sub79.4%
distribute-lft-out--79.4%
associate-*r/79.4%
mul-1-neg79.4%
unsub-neg79.4%
Simplified79.4%
div-inv79.6%
*-commutative79.6%
div-inv79.6%
pow-flip79.6%
metadata-eval79.6%
Applied egg-rr79.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 simplification96.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ x t_1)) (t_3 (/ (- x (* y z)) t_1)))
(if (<= t_3 (- INFINITY))
(- t_2 (/ z (/ t_1 y)))
(if (<= t_3 -5e-320)
t_3
(if (<= t_3 0.0)
(+ (/ y a) (* (- (/ x a) (* y (* t (pow a -2.0)))) (/ -1.0 z)))
(if (<= t_3 1e+279)
(- t_2 (/ (* y z) t_1))
(/ (- y) (- (/ t z) 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;
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_2 - (z / (t_1 / y));
} else if (t_3 <= -5e-320) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (y / a) + (((x / a) - (y * (t * pow(a, -2.0)))) * (-1.0 / z));
} else if (t_3 <= 1e+279) {
tmp = t_2 - ((y * z) / t_1);
} else {
tmp = -y / ((t / z) - 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;
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_2 - (z / (t_1 / y));
} else if (t_3 <= -5e-320) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (y / a) + (((x / a) - (y * (t * Math.pow(a, -2.0)))) * (-1.0 / z));
} else if (t_3 <= 1e+279) {
tmp = t_2 - ((y * z) / t_1);
} else {
tmp = -y / ((t / z) - a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = x / t_1 t_3 = (x - (y * z)) / t_1 tmp = 0 if t_3 <= -math.inf: tmp = t_2 - (z / (t_1 / y)) elif t_3 <= -5e-320: tmp = t_3 elif t_3 <= 0.0: tmp = (y / a) + (((x / a) - (y * (t * math.pow(a, -2.0)))) * (-1.0 / z)) elif t_3 <= 1e+279: tmp = t_2 - ((y * z) / t_1) else: tmp = -y / ((t / z) - a) return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(x / t_1) t_3 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(t_2 - Float64(z / Float64(t_1 / y))); elseif (t_3 <= -5e-320) tmp = t_3; elseif (t_3 <= 0.0) tmp = Float64(Float64(y / a) + Float64(Float64(Float64(x / a) - Float64(y * Float64(t * (a ^ -2.0)))) * Float64(-1.0 / z))); elseif (t_3 <= 1e+279) tmp = Float64(t_2 - Float64(Float64(y * z) / t_1)); else tmp = Float64(Float64(-y) / Float64(Float64(t / z) - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = x / t_1; t_3 = (x - (y * z)) / t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = t_2 - (z / (t_1 / y)); elseif (t_3 <= -5e-320) tmp = t_3; elseif (t_3 <= 0.0) tmp = (y / a) + (((x / a) - (y * (t * (a ^ -2.0)))) * (-1.0 / z)); elseif (t_3 <= 1e+279) tmp = t_2 - ((y * z) / t_1); else tmp = -y / ((t / z) - 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[(x / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(t$95$2 - N[(z / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-320], t$95$3, If[LessEqual[t$95$3, 0.0], N[(N[(y / a), $MachinePrecision] + N[(N[(N[(x / a), $MachinePrecision] - N[(y * N[(t * N[Power[a, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+279], N[(t$95$2 - N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x}{t_1}\\
t_3 := \frac{x - y \cdot z}{t_1}\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;t_2 - \frac{z}{\frac{t_1}{y}}\\
\mathbf{elif}\;t_3 \leq -5 \cdot 10^{-320}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{y}{a} + \left(\frac{x}{a} - y \cdot \left(t \cdot {a}^{-2}\right)\right) \cdot \frac{-1}{z}\\
\mathbf{elif}\;t_3 \leq 10^{+279}:\\
\;\;\;\;t_2 - \frac{y \cdot z}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-y}{\frac{t}{z} - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in x around 0 72.5%
clear-num72.5%
inv-pow72.5%
*-commutative72.5%
Applied egg-rr72.5%
unpow-172.5%
Simplified72.5%
Taylor expanded in y around 0 72.5%
+-commutative72.5%
*-commutative72.5%
mul-1-neg72.5%
unsub-neg72.5%
*-commutative72.5%
*-commutative72.5%
*-commutative72.5%
associate-/l*95.7%
*-commutative95.7%
Simplified95.7%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99994e-320Initial program 99.6%
if -4.99994e-320 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 48.0%
*-commutative48.0%
Simplified48.0%
Taylor expanded in z around inf 43.1%
+-commutative43.1%
associate--l+43.1%
associate-/r*79.4%
associate-*r/79.4%
associate-/r*79.4%
associate-*r/79.4%
div-sub79.4%
distribute-lft-out--79.4%
associate-*r/79.4%
mul-1-neg79.4%
unsub-neg79.4%
Simplified79.4%
div-inv79.6%
*-commutative79.6%
div-inv79.6%
pow-flip79.6%
metadata-eval79.6%
Applied egg-rr79.6%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.00000000000000006e279Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
if 1.00000000000000006e279 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 36.6%
*-commutative36.6%
Simplified36.6%
Taylor expanded in x around 0 25.2%
mul-1-neg25.2%
associate-/l*48.6%
*-commutative48.6%
Simplified48.6%
Taylor expanded in t around 0 88.5%
neg-mul-188.5%
+-commutative88.5%
unsub-neg88.5%
Simplified88.5%
Final simplification96.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ x t_1)) (t_3 (/ (- x (* y z)) t_1)))
(if (<= t_3 (- INFINITY))
(- t_2 (/ z (/ t_1 y)))
(if (<= t_3 -5e-320)
t_3
(if (<= t_3 0.0)
(+ (/ y a) (/ (- (* y (/ t (pow a 2.0))) (/ x a)) z))
(if (<= t_3 1e+279)
(- t_2 (/ (* y z) t_1))
(/ (- y) (- (/ t z) 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;
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_2 - (z / (t_1 / y));
} else if (t_3 <= -5e-320) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (y / a) + (((y * (t / pow(a, 2.0))) - (x / a)) / z);
} else if (t_3 <= 1e+279) {
tmp = t_2 - ((y * z) / t_1);
} else {
tmp = -y / ((t / z) - 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;
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_2 - (z / (t_1 / y));
} else if (t_3 <= -5e-320) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (y / a) + (((y * (t / Math.pow(a, 2.0))) - (x / a)) / z);
} else if (t_3 <= 1e+279) {
tmp = t_2 - ((y * z) / t_1);
} else {
tmp = -y / ((t / z) - a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = x / t_1 t_3 = (x - (y * z)) / t_1 tmp = 0 if t_3 <= -math.inf: tmp = t_2 - (z / (t_1 / y)) elif t_3 <= -5e-320: tmp = t_3 elif t_3 <= 0.0: tmp = (y / a) + (((y * (t / math.pow(a, 2.0))) - (x / a)) / z) elif t_3 <= 1e+279: tmp = t_2 - ((y * z) / t_1) else: tmp = -y / ((t / z) - a) return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(x / t_1) t_3 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(t_2 - Float64(z / Float64(t_1 / y))); elseif (t_3 <= -5e-320) tmp = t_3; elseif (t_3 <= 0.0) tmp = Float64(Float64(y / a) + Float64(Float64(Float64(y * Float64(t / (a ^ 2.0))) - Float64(x / a)) / z)); elseif (t_3 <= 1e+279) tmp = Float64(t_2 - Float64(Float64(y * z) / t_1)); else tmp = Float64(Float64(-y) / Float64(Float64(t / z) - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = x / t_1; t_3 = (x - (y * z)) / t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = t_2 - (z / (t_1 / y)); elseif (t_3 <= -5e-320) tmp = t_3; elseif (t_3 <= 0.0) tmp = (y / a) + (((y * (t / (a ^ 2.0))) - (x / a)) / z); elseif (t_3 <= 1e+279) tmp = t_2 - ((y * z) / t_1); else tmp = -y / ((t / z) - 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[(x / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(t$95$2 - N[(z / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-320], t$95$3, If[LessEqual[t$95$3, 0.0], N[(N[(y / a), $MachinePrecision] + N[(N[(N[(y * N[(t / N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+279], N[(t$95$2 - N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x}{t_1}\\
t_3 := \frac{x - y \cdot z}{t_1}\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;t_2 - \frac{z}{\frac{t_1}{y}}\\
\mathbf{elif}\;t_3 \leq -5 \cdot 10^{-320}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{y}{a} + \frac{y \cdot \frac{t}{{a}^{2}} - \frac{x}{a}}{z}\\
\mathbf{elif}\;t_3 \leq 10^{+279}:\\
\;\;\;\;t_2 - \frac{y \cdot z}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-y}{\frac{t}{z} - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in x around 0 72.5%
clear-num72.5%
inv-pow72.5%
*-commutative72.5%
Applied egg-rr72.5%
unpow-172.5%
Simplified72.5%
Taylor expanded in y around 0 72.5%
+-commutative72.5%
*-commutative72.5%
mul-1-neg72.5%
unsub-neg72.5%
*-commutative72.5%
*-commutative72.5%
*-commutative72.5%
associate-/l*95.7%
*-commutative95.7%
Simplified95.7%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99994e-320Initial program 99.6%
if -4.99994e-320 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 48.0%
*-commutative48.0%
Simplified48.0%
Taylor expanded in z around inf 43.1%
+-commutative43.1%
associate--l+43.1%
associate-/r*79.4%
associate-*r/79.4%
associate-/r*79.4%
associate-*r/79.4%
div-sub79.4%
distribute-lft-out--79.4%
associate-*r/79.4%
mul-1-neg79.4%
unsub-neg79.4%
Simplified79.4%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.00000000000000006e279Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
if 1.00000000000000006e279 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 36.6%
*-commutative36.6%
Simplified36.6%
Taylor expanded in x around 0 25.2%
mul-1-neg25.2%
associate-/l*48.6%
*-commutative48.6%
Simplified48.6%
Taylor expanded in t around 0 88.5%
neg-mul-188.5%
+-commutative88.5%
unsub-neg88.5%
Simplified88.5%
Final simplification95.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) t)) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -1.95e+67)
t_2
(if (<= z -9.2e-37)
t_1
(if (<= z -5.5e-87)
t_2
(if (<= z 3.3e-96)
(/ x (- t (* z a)))
(if (<= z 2.4e+19) t_1 t_2)))))))
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 (z <= -1.95e+67) {
tmp = t_2;
} else if (z <= -9.2e-37) {
tmp = t_1;
} else if (z <= -5.5e-87) {
tmp = t_2;
} else if (z <= 3.3e-96) {
tmp = x / (t - (z * a));
} else if (z <= 2.4e+19) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x - (y * z)) / t
t_2 = (y - (x / z)) / a
if (z <= (-1.95d+67)) then
tmp = t_2
else if (z <= (-9.2d-37)) then
tmp = t_1
else if (z <= (-5.5d-87)) then
tmp = t_2
else if (z <= 3.3d-96) then
tmp = x / (t - (z * a))
else if (z <= 2.4d+19) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.95e+67) {
tmp = t_2;
} else if (z <= -9.2e-37) {
tmp = t_1;
} else if (z <= -5.5e-87) {
tmp = t_2;
} else if (z <= 3.3e-96) {
tmp = x / (t - (z * a));
} else if (z <= 2.4e+19) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / t t_2 = (y - (x / z)) / a tmp = 0 if z <= -1.95e+67: tmp = t_2 elif z <= -9.2e-37: tmp = t_1 elif z <= -5.5e-87: tmp = t_2 elif z <= 3.3e-96: tmp = x / (t - (z * a)) elif z <= 2.4e+19: tmp = t_1 else: tmp = t_2 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 (z <= -1.95e+67) tmp = t_2; elseif (z <= -9.2e-37) tmp = t_1; elseif (z <= -5.5e-87) tmp = t_2; elseif (z <= 3.3e-96) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 2.4e+19) tmp = t_1; else tmp = t_2; 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 (z <= -1.95e+67) tmp = t_2; elseif (z <= -9.2e-37) tmp = t_1; elseif (z <= -5.5e-87) tmp = t_2; elseif (z <= 3.3e-96) tmp = x / (t - (z * a)); elseif (z <= 2.4e+19) tmp = t_1; else tmp = t_2; 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[z, -1.95e+67], t$95$2, If[LessEqual[z, -9.2e-37], t$95$1, If[LessEqual[z, -5.5e-87], t$95$2, If[LessEqual[z, 3.3e-96], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+19], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{+67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-87}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-96}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.95000000000000003e67 or -9.1999999999999999e-37 < z < -5.5000000000000004e-87 or 2.4e19 < z Initial program 68.1%
*-commutative68.1%
Simplified68.1%
Taylor expanded in z around inf 60.2%
+-commutative60.2%
associate--l+60.2%
associate-/r*64.2%
associate-*r/64.2%
associate-/r*62.6%
associate-*r/62.6%
div-sub62.6%
distribute-lft-out--62.6%
associate-*r/62.6%
mul-1-neg62.6%
unsub-neg62.6%
Simplified66.7%
Taylor expanded in a around inf 79.4%
if -1.95000000000000003e67 < z < -9.1999999999999999e-37 or 3.2999999999999999e-96 < z < 2.4e19Initial program 97.5%
*-commutative97.5%
Simplified97.5%
Taylor expanded in t around inf 75.1%
if -5.5000000000000004e-87 < z < 3.2999999999999999e-96Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 81.1%
*-commutative81.1%
Simplified81.1%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= z -9.5e+90)
(/ y a)
(if (<= z 6.8e-98)
t_1
(if (<= z 3.7e+18)
(/ (- x (* y z)) t)
(if (<= z 2.92e+93) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -9.5e+90) {
tmp = y / a;
} else if (z <= 6.8e-98) {
tmp = t_1;
} else if (z <= 3.7e+18) {
tmp = (x - (y * z)) / t;
} else if (z <= 2.92e+93) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x / (t - (z * a))
if (z <= (-9.5d+90)) then
tmp = y / a
else if (z <= 6.8d-98) then
tmp = t_1
else if (z <= 3.7d+18) then
tmp = (x - (y * z)) / t
else if (z <= 2.92d+93) then
tmp = t_1
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -9.5e+90) {
tmp = y / a;
} else if (z <= 6.8e-98) {
tmp = t_1;
} else if (z <= 3.7e+18) {
tmp = (x - (y * z)) / t;
} else if (z <= 2.92e+93) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if z <= -9.5e+90: tmp = y / a elif z <= 6.8e-98: tmp = t_1 elif z <= 3.7e+18: tmp = (x - (y * z)) / t elif z <= 2.92e+93: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (z <= -9.5e+90) tmp = Float64(y / a); elseif (z <= 6.8e-98) tmp = t_1; elseif (z <= 3.7e+18) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 2.92e+93) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (z <= -9.5e+90) tmp = y / a; elseif (z <= 6.8e-98) tmp = t_1; elseif (z <= 3.7e+18) tmp = (x - (y * z)) / t; elseif (z <= 2.92e+93) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e+90], N[(y / a), $MachinePrecision], If[LessEqual[z, 6.8e-98], t$95$1, If[LessEqual[z, 3.7e+18], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.92e+93], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+18}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 2.92 \cdot 10^{+93}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -9.4999999999999994e90 or 2.9200000000000002e93 < z Initial program 63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in z around inf 71.4%
if -9.4999999999999994e90 < z < 6.8000000000000003e-98 or 3.7e18 < z < 2.9200000000000002e93Initial program 96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in x around inf 70.4%
*-commutative70.4%
Simplified70.4%
if 6.8000000000000003e-98 < z < 3.7e18Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 84.7%
Final simplification72.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.6e+94) (not (<= z 2.92e+93))) (/ (- y) (- (/ t z) a)) (/ (- x (* y z)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.6e+94) || !(z <= 2.92e+93)) {
tmp = -y / ((t / z) - a);
} else {
tmp = (x - (y * z)) / (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 <= (-6.6d+94)) .or. (.not. (z <= 2.92d+93))) then
tmp = -y / ((t / z) - a)
else
tmp = (x - (y * z)) / (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 <= -6.6e+94) || !(z <= 2.92e+93)) {
tmp = -y / ((t / z) - a);
} else {
tmp = (x - (y * z)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.6e+94) or not (z <= 2.92e+93): tmp = -y / ((t / z) - a) else: tmp = (x - (y * z)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.6e+94) || !(z <= 2.92e+93)) tmp = Float64(Float64(-y) / Float64(Float64(t / z) - a)); else tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.6e+94) || ~((z <= 2.92e+93))) tmp = -y / ((t / z) - a); else tmp = (x - (y * z)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.6e+94], N[Not[LessEqual[z, 2.92e+93]], $MachinePrecision]], N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+94} \lor \neg \left(z \leq 2.92 \cdot 10^{+93}\right):\\
\;\;\;\;\frac{-y}{\frac{t}{z} - a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -6.6e94 or 2.9200000000000002e93 < z Initial program 63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in x around 0 54.7%
mul-1-neg54.7%
associate-/l*66.1%
*-commutative66.1%
Simplified66.1%
Taylor expanded in t around 0 85.3%
neg-mul-185.3%
+-commutative85.3%
unsub-neg85.3%
Simplified85.3%
if -6.6e94 < z < 2.9200000000000002e93Initial program 96.9%
Final simplification92.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y) (- (/ t z) a))))
(if (<= z -2.35e-45)
t_1
(if (<= z 4.5e-96)
(/ x (- t (* z a)))
(if (<= z 8.8e+24) (/ (- x (* y z)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -y / ((t / z) - a);
double tmp;
if (z <= -2.35e-45) {
tmp = t_1;
} else if (z <= 4.5e-96) {
tmp = x / (t - (z * a));
} else if (z <= 8.8e+24) {
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 = -y / ((t / z) - a)
if (z <= (-2.35d-45)) then
tmp = t_1
else if (z <= 4.5d-96) then
tmp = x / (t - (z * a))
else if (z <= 8.8d+24) 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 = -y / ((t / z) - a);
double tmp;
if (z <= -2.35e-45) {
tmp = t_1;
} else if (z <= 4.5e-96) {
tmp = x / (t - (z * a));
} else if (z <= 8.8e+24) {
tmp = (x - (y * z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -y / ((t / z) - a) tmp = 0 if z <= -2.35e-45: tmp = t_1 elif z <= 4.5e-96: tmp = x / (t - (z * a)) elif z <= 8.8e+24: tmp = (x - (y * z)) / t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-y) / Float64(Float64(t / z) - a)) tmp = 0.0 if (z <= -2.35e-45) tmp = t_1; elseif (z <= 4.5e-96) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 8.8e+24) 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 = -y / ((t / z) - a); tmp = 0.0; if (z <= -2.35e-45) tmp = t_1; elseif (z <= 4.5e-96) tmp = x / (t - (z * a)); elseif (z <= 8.8e+24) 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[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.35e-45], t$95$1, If[LessEqual[z, 4.5e-96], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+24], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-y}{\frac{t}{z} - a}\\
\mathbf{if}\;z \leq -2.35 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-96}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+24}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.3499999999999999e-45 or 8.80000000000000007e24 < z Initial program 70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in x around 0 54.1%
mul-1-neg54.1%
associate-/l*64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in t around 0 78.5%
neg-mul-178.5%
+-commutative78.5%
unsub-neg78.5%
Simplified78.5%
if -2.3499999999999999e-45 < z < 4.5e-96Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 79.5%
*-commutative79.5%
Simplified79.5%
if 4.5e-96 < z < 8.80000000000000007e24Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 81.8%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e+92) (not (<= z 2.92e+93))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e+92) || !(z <= 2.92e+93)) {
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 <= (-1.15d+92)) .or. (.not. (z <= 2.92d+93))) 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 <= -1.15e+92) || !(z <= 2.92e+93)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e+92) or not (z <= 2.92e+93): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.15e+92) || !(z <= 2.92e+93)) 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 <= -1.15e+92) || ~((z <= 2.92e+93))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e+92], N[Not[LessEqual[z, 2.92e+93]], $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 -1.15 \cdot 10^{+92} \lor \neg \left(z \leq 2.92 \cdot 10^{+93}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -1.14999999999999999e92 or 2.9200000000000002e93 < z Initial program 63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in z around inf 71.4%
if -1.14999999999999999e92 < z < 2.9200000000000002e93Initial program 96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in x around inf 68.5%
*-commutative68.5%
Simplified68.5%
Final simplification69.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.15e-58)
(/ y a)
(if (<= z -1.45e-154)
(/ (- x) (* z a))
(if (<= z 1.4e+24) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.15e-58) {
tmp = y / a;
} else if (z <= -1.45e-154) {
tmp = -x / (z * a);
} else if (z <= 1.4e+24) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.15d-58)) then
tmp = y / a
else if (z <= (-1.45d-154)) then
tmp = -x / (z * a)
else if (z <= 1.4d+24) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.15e-58) {
tmp = y / a;
} else if (z <= -1.45e-154) {
tmp = -x / (z * a);
} else if (z <= 1.4e+24) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.15e-58: tmp = y / a elif z <= -1.45e-154: tmp = -x / (z * a) elif z <= 1.4e+24: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.15e-58) tmp = Float64(y / a); elseif (z <= -1.45e-154) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 1.4e+24) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.15e-58) tmp = y / a; elseif (z <= -1.45e-154) tmp = -x / (z * a); elseif (z <= 1.4e+24) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.15e-58], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.45e-154], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+24], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{-58}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-154}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+24}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.14999999999999999e-58 or 1.4000000000000001e24 < z Initial program 70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in z around inf 59.7%
if -3.14999999999999999e-58 < z < -1.45e-154Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 59.3%
+-commutative59.3%
associate--l+59.3%
associate-/r*59.1%
associate-*r/59.1%
associate-/r*59.1%
associate-*r/59.1%
div-sub59.1%
distribute-lft-out--59.1%
associate-*r/59.1%
mul-1-neg59.1%
unsub-neg59.1%
Simplified59.4%
Taylor expanded in y around 0 55.2%
mul-1-neg55.2%
Simplified55.2%
if -1.45e-154 < z < 1.4000000000000001e24Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 60.3%
Final simplification59.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.4e-30) (not (<= z 8.5e+26))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e-30) || !(z <= 8.5e+26)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.4d-30)) .or. (.not. (z <= 8.5d+26))) then
tmp = y / a
else
tmp = x / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e-30) || !(z <= 8.5e+26)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.4e-30) or not (z <= 8.5e+26): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.4e-30) || !(z <= 8.5e+26)) tmp = Float64(y / a); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.4e-30) || ~((z <= 8.5e+26))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.4e-30], N[Not[LessEqual[z, 8.5e+26]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-30} \lor \neg \left(z \leq 8.5 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -3.4000000000000003e-30 or 8.5e26 < z Initial program 69.0%
*-commutative69.0%
Simplified69.0%
Taylor expanded in z around inf 61.3%
if -3.4000000000000003e-30 < z < 8.5e26Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 53.9%
Final simplification57.6%
(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.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around 0 32.4%
Final simplification32.4%
(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 2023336
(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))))