
(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 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)))
(if (<= t_2 (- INFINITY))
(* y (- (/ x (* y t_1)) (/ z t_1)))
(if (<= t_2 5e+302)
(+ (/ (* y z) (- (* z a) t)) (/ x t_1))
(* y (/ (- 1.0 (/ x (* y z))) a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = y * ((x / (y * t_1)) - (z / t_1));
} else if (t_2 <= 5e+302) {
tmp = ((y * z) / ((z * a) - t)) + (x / t_1);
} else {
tmp = y * ((1.0 - (x / (y * 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 - (y * z)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = y * ((x / (y * t_1)) - (z / t_1));
} else if (t_2 <= 5e+302) {
tmp = ((y * z) / ((z * a) - t)) + (x / t_1);
} else {
tmp = y * ((1.0 - (x / (y * z))) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (x - (y * z)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = y * ((x / (y * t_1)) - (z / t_1)) elif t_2 <= 5e+302: tmp = ((y * z) / ((z * a) - t)) + (x / t_1) else: tmp = y * ((1.0 - (x / (y * z))) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(x / Float64(y * t_1)) - Float64(z / t_1))); elseif (t_2 <= 5e+302) tmp = Float64(Float64(Float64(y * z) / Float64(Float64(z * a) - t)) + Float64(x / t_1)); else tmp = Float64(y * Float64(Float64(1.0 - Float64(x / Float64(y * z))) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (x - (y * z)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = y * ((x / (y * t_1)) - (z / t_1)); elseif (t_2 <= 5e+302) tmp = ((y * z) / ((z * a) - t)) + (x / t_1); else tmp = y * ((1.0 - (x / (y * 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[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(y * N[(N[(x / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+302], N[(N[(N[(y * z), $MachinePrecision] / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(1.0 - N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x - y \cdot z}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;y \cdot \left(\frac{x}{y \cdot t\_1} - \frac{z}{t\_1}\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;\frac{y \cdot z}{z \cdot a - t} + \frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1 - \frac{x}{y \cdot z}}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 47.9%
*-commutative47.9%
Simplified47.9%
Taylor expanded in y around inf 99.9%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5e302Initial program 96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in x around 0 96.3%
if 5e302 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 38.0%
*-commutative38.0%
Simplified38.0%
Taylor expanded in y around inf 57.9%
Taylor expanded in a around inf 99.8%
associate-*r/99.8%
neg-mul-199.8%
*-commutative99.8%
Simplified99.8%
Final simplification97.0%
(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+302)
(+ (/ (* y z) t_1) (/ x t_2))
(* y (/ (- 1.0 (/ x (* y z))) 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+302) {
tmp = ((y * z) / t_1) + (x / t_2);
} else {
tmp = y * ((1.0 - (x / (y * z))) / 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+302) {
tmp = ((y * z) / t_1) + (x / t_2);
} else {
tmp = y * ((1.0 - (x / (y * z))) / 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+302: tmp = ((y * z) / t_1) + (x / t_2) else: tmp = y * ((1.0 - (x / (y * z))) / 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+302) tmp = Float64(Float64(Float64(y * z) / t_1) + Float64(x / t_2)); else tmp = Float64(y * Float64(Float64(1.0 - Float64(x / Float64(y * z))) / 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+302) tmp = ((y * z) / t_1) + (x / t_2); else tmp = y * ((1.0 - (x / (y * z))) / 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+302], N[(N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(1.0 - N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $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^{+302}:\\
\;\;\;\;\frac{y \cdot z}{t\_1} + \frac{x}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1 - \frac{x}{y \cdot z}}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 47.9%
*-commutative47.9%
Simplified47.9%
Taylor expanded in x around 0 39.1%
mul-1-neg39.1%
associate-/l*91.0%
distribute-rgt-neg-in91.0%
sub-neg91.0%
mul-1-neg91.0%
+-commutative91.0%
mul-1-neg91.0%
distribute-rgt-neg-in91.0%
fma-undefine91.0%
distribute-neg-frac291.0%
neg-sub091.0%
fma-undefine91.0%
distribute-rgt-neg-in91.0%
distribute-lft-neg-in91.0%
*-commutative91.0%
associate--r+91.0%
neg-sub091.0%
distribute-rgt-neg-out91.0%
remove-double-neg91.0%
*-commutative91.0%
Simplified91.0%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5e302Initial program 96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in x around 0 96.3%
if 5e302 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 38.0%
*-commutative38.0%
Simplified38.0%
Taylor expanded in y around inf 57.9%
Taylor expanded in a around inf 99.8%
associate-*r/99.8%
neg-mul-199.8%
*-commutative99.8%
Simplified99.8%
Final simplification96.2%
(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 5e+302) t_1 (* y (/ (- 1.0 (/ x (* y z))) 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 <= 5e+302) {
tmp = t_1;
} else {
tmp = y * ((1.0 - (x / (y * z))) / 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 <= 5e+302) {
tmp = t_1;
} else {
tmp = y * ((1.0 - (x / (y * z))) / 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 <= 5e+302: tmp = t_1 else: tmp = y * ((1.0 - (x / (y * z))) / 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 <= 5e+302) tmp = t_1; else tmp = Float64(y * Float64(Float64(1.0 - Float64(x / Float64(y * z))) / 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 <= 5e+302) tmp = t_1; else tmp = y * ((1.0 - (x / (y * z))) / 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, 5e+302], t$95$1, N[(y * N[(N[(1.0 - N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $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 5 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1 - \frac{x}{y \cdot z}}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 47.9%
*-commutative47.9%
Simplified47.9%
Taylor expanded in x around 0 39.1%
mul-1-neg39.1%
associate-/l*91.0%
distribute-rgt-neg-in91.0%
sub-neg91.0%
mul-1-neg91.0%
+-commutative91.0%
mul-1-neg91.0%
distribute-rgt-neg-in91.0%
fma-undefine91.0%
distribute-neg-frac291.0%
neg-sub091.0%
fma-undefine91.0%
distribute-rgt-neg-in91.0%
distribute-lft-neg-in91.0%
*-commutative91.0%
associate--r+91.0%
neg-sub091.0%
distribute-rgt-neg-out91.0%
remove-double-neg91.0%
*-commutative91.0%
Simplified91.0%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5e302Initial program 96.2%
if 5e302 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 38.0%
*-commutative38.0%
Simplified38.0%
Taylor expanded in y around inf 57.9%
Taylor expanded in a around inf 99.8%
associate-*r/99.8%
neg-mul-199.8%
*-commutative99.8%
Simplified99.8%
Final simplification96.2%
(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 5e+302) t_1 (- (/ y a) (/ x (* z 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 <= 5e+302) {
tmp = t_1;
} else {
tmp = (y / a) - (x / (z * 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 <= 5e+302) {
tmp = t_1;
} else {
tmp = (y / a) - (x / (z * 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 <= 5e+302: tmp = t_1 else: tmp = (y / a) - (x / (z * 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 <= 5e+302) tmp = t_1; else tmp = Float64(Float64(y / a) - Float64(x / Float64(z * 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 <= 5e+302) tmp = t_1; else tmp = (y / a) - (x / (z * 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, 5e+302], t$95$1, N[(N[(y / a), $MachinePrecision] - N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), $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 5 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 47.9%
*-commutative47.9%
Simplified47.9%
Taylor expanded in x around 0 39.1%
mul-1-neg39.1%
associate-/l*91.0%
distribute-rgt-neg-in91.0%
sub-neg91.0%
mul-1-neg91.0%
+-commutative91.0%
mul-1-neg91.0%
distribute-rgt-neg-in91.0%
fma-undefine91.0%
distribute-neg-frac291.0%
neg-sub091.0%
fma-undefine91.0%
distribute-rgt-neg-in91.0%
distribute-lft-neg-in91.0%
*-commutative91.0%
associate--r+91.0%
neg-sub091.0%
distribute-rgt-neg-out91.0%
remove-double-neg91.0%
*-commutative91.0%
Simplified91.0%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5e302Initial program 96.2%
if 5e302 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 38.0%
*-commutative38.0%
Simplified38.0%
Taylor expanded in t around 0 38.0%
associate-*r/38.0%
mul-1-neg38.0%
sub-neg38.0%
distribute-rgt-neg-out38.0%
+-commutative38.0%
fma-define38.0%
neg-sub038.0%
fma-define38.0%
associate--r+38.0%
neg-sub038.0%
distribute-rgt-neg-out38.0%
remove-double-neg38.0%
*-commutative38.0%
Simplified38.0%
Taylor expanded in z around inf 96.7%
+-commutative96.7%
mul-1-neg96.7%
unsub-neg96.7%
Simplified96.7%
Final simplification95.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) t)))
(if (<= y -7.8e+117)
(/ y a)
(if (<= y -8.5e-85)
t_1
(if (<= y 5.8e-9)
(/ x (- t (* z a)))
(if (<= y 6.8e+224) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / t;
double tmp;
if (y <= -7.8e+117) {
tmp = y / a;
} else if (y <= -8.5e-85) {
tmp = t_1;
} else if (y <= 5.8e-9) {
tmp = x / (t - (z * a));
} else if (y <= 6.8e+224) {
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 - (y * z)) / t
if (y <= (-7.8d+117)) then
tmp = y / a
else if (y <= (-8.5d-85)) then
tmp = t_1
else if (y <= 5.8d-9) then
tmp = x / (t - (z * a))
else if (y <= 6.8d+224) 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 - (y * z)) / t;
double tmp;
if (y <= -7.8e+117) {
tmp = y / a;
} else if (y <= -8.5e-85) {
tmp = t_1;
} else if (y <= 5.8e-9) {
tmp = x / (t - (z * a));
} else if (y <= 6.8e+224) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / t tmp = 0 if y <= -7.8e+117: tmp = y / a elif y <= -8.5e-85: tmp = t_1 elif y <= 5.8e-9: tmp = x / (t - (z * a)) elif y <= 6.8e+224: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / t) tmp = 0.0 if (y <= -7.8e+117) tmp = Float64(y / a); elseif (y <= -8.5e-85) tmp = t_1; elseif (y <= 5.8e-9) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (y <= 6.8e+224) 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; tmp = 0.0; if (y <= -7.8e+117) tmp = y / a; elseif (y <= -8.5e-85) tmp = t_1; elseif (y <= 5.8e-9) tmp = x / (t - (z * a)); elseif (y <= 6.8e+224) 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] / t), $MachinePrecision]}, If[LessEqual[y, -7.8e+117], N[(y / a), $MachinePrecision], If[LessEqual[y, -8.5e-85], t$95$1, If[LessEqual[y, 5.8e-9], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+224], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t}\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{+117}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if y < -7.79999999999999981e117 or 6.8000000000000004e224 < y Initial program 61.0%
*-commutative61.0%
Simplified61.0%
Taylor expanded in z around inf 65.8%
if -7.79999999999999981e117 < y < -8.50000000000000052e-85 or 5.79999999999999982e-9 < y < 6.8000000000000004e224Initial program 89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in t around inf 63.8%
*-commutative63.8%
Simplified63.8%
if -8.50000000000000052e-85 < y < 5.79999999999999982e-9Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in x around inf 82.0%
Final simplification72.7%
(FPCore (x y z t a)
:precision binary64
(if (<= y -4.5e+139)
(/ y a)
(if (<= y -9.2e-85)
(* y (/ (- (/ x y) z) t))
(if (<= y 0.0029) (/ x (- t (* z a))) (* y (/ z (- (* z a) t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.5e+139) {
tmp = y / a;
} else if (y <= -9.2e-85) {
tmp = y * (((x / y) - z) / t);
} else if (y <= 0.0029) {
tmp = x / (t - (z * a));
} else {
tmp = y * (z / ((z * a) - 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 <= (-4.5d+139)) then
tmp = y / a
else if (y <= (-9.2d-85)) then
tmp = y * (((x / y) - z) / t)
else if (y <= 0.0029d0) then
tmp = x / (t - (z * a))
else
tmp = y * (z / ((z * a) - 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 <= -4.5e+139) {
tmp = y / a;
} else if (y <= -9.2e-85) {
tmp = y * (((x / y) - z) / t);
} else if (y <= 0.0029) {
tmp = x / (t - (z * a));
} else {
tmp = y * (z / ((z * a) - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.5e+139: tmp = y / a elif y <= -9.2e-85: tmp = y * (((x / y) - z) / t) elif y <= 0.0029: tmp = x / (t - (z * a)) else: tmp = y * (z / ((z * a) - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.5e+139) tmp = Float64(y / a); elseif (y <= -9.2e-85) tmp = Float64(y * Float64(Float64(Float64(x / y) - z) / t)); elseif (y <= 0.0029) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = Float64(y * Float64(z / Float64(Float64(z * a) - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.5e+139) tmp = y / a; elseif (y <= -9.2e-85) tmp = y * (((x / y) - z) / t); elseif (y <= 0.0029) tmp = x / (t - (z * a)); else tmp = y * (z / ((z * a) - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.5e+139], N[(y / a), $MachinePrecision], If[LessEqual[y, -9.2e-85], N[(y * N[(N[(N[(x / y), $MachinePrecision] - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.0029], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+139}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;y \leq -9.2 \cdot 10^{-85}:\\
\;\;\;\;y \cdot \frac{\frac{x}{y} - z}{t}\\
\mathbf{elif}\;y \leq 0.0029:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot a - t}\\
\end{array}
\end{array}
if y < -4.4999999999999999e139Initial program 61.0%
*-commutative61.0%
Simplified61.0%
Taylor expanded in z around inf 65.5%
if -4.4999999999999999e139 < y < -9.2000000000000001e-85Initial program 87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y around inf 90.4%
Taylor expanded in t around -inf 63.9%
mul-1-neg63.9%
mul-1-neg63.9%
sub-neg63.9%
Simplified63.9%
Taylor expanded in y around inf 63.9%
mul-1-neg63.9%
distribute-frac-neg263.9%
+-commutative63.9%
distribute-frac-neg263.9%
sub-neg63.9%
associate-/l/63.9%
div-sub63.9%
Simplified63.9%
if -9.2000000000000001e-85 < y < 0.0029Initial program 94.7%
*-commutative94.7%
Simplified94.7%
Taylor expanded in x around inf 82.2%
if 0.0029 < y Initial program 81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in x around 0 66.3%
mul-1-neg66.3%
associate-/l*76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
mul-1-neg76.5%
+-commutative76.5%
mul-1-neg76.5%
distribute-rgt-neg-in76.5%
fma-undefine76.5%
distribute-neg-frac276.5%
neg-sub076.5%
fma-undefine76.5%
distribute-rgt-neg-in76.5%
distribute-lft-neg-in76.5%
*-commutative76.5%
associate--r+76.5%
neg-sub076.5%
distribute-rgt-neg-out76.5%
remove-double-neg76.5%
*-commutative76.5%
Simplified76.5%
Final simplification75.4%
(FPCore (x y z t a)
:precision binary64
(if (<= y -8.8e+120)
(/ y a)
(if (<= y -2.8e-85)
(/ (- x (* y z)) t)
(if (<= y 0.00041) (/ x (- t (* z a))) (* y (/ z (- (* z a) t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -8.8e+120) {
tmp = y / a;
} else if (y <= -2.8e-85) {
tmp = (x - (y * z)) / t;
} else if (y <= 0.00041) {
tmp = x / (t - (z * a));
} else {
tmp = y * (z / ((z * a) - 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 <= (-8.8d+120)) then
tmp = y / a
else if (y <= (-2.8d-85)) then
tmp = (x - (y * z)) / t
else if (y <= 0.00041d0) then
tmp = x / (t - (z * a))
else
tmp = y * (z / ((z * a) - 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 <= -8.8e+120) {
tmp = y / a;
} else if (y <= -2.8e-85) {
tmp = (x - (y * z)) / t;
} else if (y <= 0.00041) {
tmp = x / (t - (z * a));
} else {
tmp = y * (z / ((z * a) - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -8.8e+120: tmp = y / a elif y <= -2.8e-85: tmp = (x - (y * z)) / t elif y <= 0.00041: tmp = x / (t - (z * a)) else: tmp = y * (z / ((z * a) - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -8.8e+120) tmp = Float64(y / a); elseif (y <= -2.8e-85) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (y <= 0.00041) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = Float64(y * Float64(z / Float64(Float64(z * a) - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -8.8e+120) tmp = y / a; elseif (y <= -2.8e-85) tmp = (x - (y * z)) / t; elseif (y <= 0.00041) tmp = x / (t - (z * a)); else tmp = y * (z / ((z * a) - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -8.8e+120], N[(y / a), $MachinePrecision], If[LessEqual[y, -2.8e-85], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 0.00041], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{+120}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-85}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;y \leq 0.00041:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot a - t}\\
\end{array}
\end{array}
if y < -8.8000000000000005e120Initial program 63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in z around inf 63.1%
if -8.8000000000000005e120 < y < -2.80000000000000017e-85Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in t around inf 64.0%
*-commutative64.0%
Simplified64.0%
if -2.80000000000000017e-85 < y < 4.0999999999999999e-4Initial program 94.7%
*-commutative94.7%
Simplified94.7%
Taylor expanded in x around inf 82.2%
if 4.0999999999999999e-4 < y Initial program 81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in x around 0 66.3%
mul-1-neg66.3%
associate-/l*76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
mul-1-neg76.5%
+-commutative76.5%
mul-1-neg76.5%
distribute-rgt-neg-in76.5%
fma-undefine76.5%
distribute-neg-frac276.5%
neg-sub076.5%
fma-undefine76.5%
distribute-rgt-neg-in76.5%
distribute-lft-neg-in76.5%
*-commutative76.5%
associate--r+76.5%
neg-sub076.5%
distribute-rgt-neg-out76.5%
remove-double-neg76.5%
*-commutative76.5%
Simplified76.5%
Final simplification75.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -105000000.0)
(/ y a)
(if (<= z 1.35e-107)
(/ x t)
(if (<= z 1.05e+52) (* z (/ (- y) t)) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -105000000.0) {
tmp = y / a;
} else if (z <= 1.35e-107) {
tmp = x / t;
} else if (z <= 1.05e+52) {
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 <= (-105000000.0d0)) then
tmp = y / a
else if (z <= 1.35d-107) then
tmp = x / t
else if (z <= 1.05d+52) 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 <= -105000000.0) {
tmp = y / a;
} else if (z <= 1.35e-107) {
tmp = x / t;
} else if (z <= 1.05e+52) {
tmp = z * (-y / t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -105000000.0: tmp = y / a elif z <= 1.35e-107: tmp = x / t elif z <= 1.05e+52: tmp = z * (-y / t) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -105000000.0) tmp = Float64(y / a); elseif (z <= 1.35e-107) tmp = Float64(x / t); elseif (z <= 1.05e+52) 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 <= -105000000.0) tmp = y / a; elseif (z <= 1.35e-107) tmp = x / t; elseif (z <= 1.05e+52) tmp = z * (-y / t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -105000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.35e-107], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.05e+52], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -105000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-107}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+52}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.05e8 or 1.05e52 < z Initial program 70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in z around inf 62.3%
if -1.05e8 < z < 1.35e-107Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 60.6%
if 1.35e-107 < z < 1.05e52Initial program 96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 67.4%
mul-1-neg67.4%
associate-/l*67.6%
distribute-rgt-neg-in67.6%
sub-neg67.6%
mul-1-neg67.6%
+-commutative67.6%
mul-1-neg67.6%
distribute-rgt-neg-in67.6%
fma-undefine67.6%
distribute-neg-frac267.6%
neg-sub067.6%
fma-undefine67.6%
distribute-rgt-neg-in67.6%
distribute-lft-neg-in67.6%
*-commutative67.6%
associate--r+67.6%
neg-sub067.6%
distribute-rgt-neg-out67.6%
remove-double-neg67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in z around 0 49.9%
associate-*r/49.9%
*-commutative49.9%
neg-mul-149.9%
Simplified49.9%
Taylor expanded in z around 0 49.9%
neg-mul-149.9%
distribute-neg-frac49.9%
distribute-rgt-neg-in49.9%
*-commutative49.9%
associate-*r/50.1%
*-commutative50.1%
Simplified50.1%
Final simplification60.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1700000000.0)
(/ y a)
(if (<= z 2.15e-107)
(/ x t)
(if (<= z 1.28e+51) (* (- y) (/ z t)) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1700000000.0) {
tmp = y / a;
} else if (z <= 2.15e-107) {
tmp = x / t;
} else if (z <= 1.28e+51) {
tmp = -y * (z / 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 <= (-1700000000.0d0)) then
tmp = y / a
else if (z <= 2.15d-107) then
tmp = x / t
else if (z <= 1.28d+51) then
tmp = -y * (z / 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 <= -1700000000.0) {
tmp = y / a;
} else if (z <= 2.15e-107) {
tmp = x / t;
} else if (z <= 1.28e+51) {
tmp = -y * (z / t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1700000000.0: tmp = y / a elif z <= 2.15e-107: tmp = x / t elif z <= 1.28e+51: tmp = -y * (z / t) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1700000000.0) tmp = Float64(y / a); elseif (z <= 2.15e-107) tmp = Float64(x / t); elseif (z <= 1.28e+51) tmp = Float64(Float64(-y) * Float64(z / t)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1700000000.0) tmp = y / a; elseif (z <= 2.15e-107) tmp = x / t; elseif (z <= 1.28e+51) tmp = -y * (z / t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1700000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, 2.15e-107], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.28e+51], N[((-y) * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1700000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-107}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{+51}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.7e9 or 1.27999999999999993e51 < z Initial program 70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in z around inf 62.3%
if -1.7e9 < z < 2.1499999999999999e-107Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 60.6%
if 2.1499999999999999e-107 < z < 1.27999999999999993e51Initial program 96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 67.4%
mul-1-neg67.4%
associate-/l*67.6%
distribute-rgt-neg-in67.6%
sub-neg67.6%
mul-1-neg67.6%
+-commutative67.6%
mul-1-neg67.6%
distribute-rgt-neg-in67.6%
fma-undefine67.6%
distribute-neg-frac267.6%
neg-sub067.6%
fma-undefine67.6%
distribute-rgt-neg-in67.6%
distribute-lft-neg-in67.6%
*-commutative67.6%
associate--r+67.6%
neg-sub067.6%
distribute-rgt-neg-out67.6%
remove-double-neg67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in a around 0 47.2%
neg-mul-147.2%
Simplified47.2%
Final simplification59.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.2e+32) (not (<= a 6e-84))) (- (/ y a) (/ x (* z a))) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.2e+32) || !(a <= 6e-84)) {
tmp = (y / a) - (x / (z * a));
} 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) :: tmp
if ((a <= (-5.2d+32)) .or. (.not. (a <= 6d-84))) then
tmp = (y / a) - (x / (z * a))
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 tmp;
if ((a <= -5.2e+32) || !(a <= 6e-84)) {
tmp = (y / a) - (x / (z * a));
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.2e+32) or not (a <= 6e-84): tmp = (y / a) - (x / (z * a)) else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.2e+32) || !(a <= 6e-84)) tmp = Float64(Float64(y / a) - Float64(x / Float64(z * a))); else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5.2e+32) || ~((a <= 6e-84))) tmp = (y / a) - (x / (z * a)); else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.2e+32], N[Not[LessEqual[a, 6e-84]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] - N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{+32} \lor \neg \left(a \leq 6 \cdot 10^{-84}\right):\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if a < -5.2000000000000004e32 or 6.0000000000000002e-84 < a Initial program 78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in t around 0 56.3%
associate-*r/56.3%
mul-1-neg56.3%
sub-neg56.3%
distribute-rgt-neg-out56.3%
+-commutative56.3%
fma-define56.3%
neg-sub056.3%
fma-define56.3%
associate--r+56.3%
neg-sub056.3%
distribute-rgt-neg-out56.3%
remove-double-neg56.3%
*-commutative56.3%
Simplified56.3%
Taylor expanded in z around inf 75.5%
+-commutative75.5%
mul-1-neg75.5%
unsub-neg75.5%
Simplified75.5%
if -5.2000000000000004e32 < a < 6.0000000000000002e-84Initial program 94.0%
*-commutative94.0%
Simplified94.0%
Taylor expanded in t around inf 77.6%
*-commutative77.6%
Simplified77.6%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.35e+168) (not (<= y 4.2e+17))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.35e+168) || !(y <= 4.2e+17)) {
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 ((y <= (-1.35d+168)) .or. (.not. (y <= 4.2d+17))) 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 ((y <= -1.35e+168) || !(y <= 4.2e+17)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.35e+168) or not (y <= 4.2e+17): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.35e+168) || !(y <= 4.2e+17)) 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 ((y <= -1.35e+168) || ~((y <= 4.2e+17))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.35e+168], N[Not[LessEqual[y, 4.2e+17]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+168} \lor \neg \left(y \leq 4.2 \cdot 10^{+17}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if y < -1.35000000000000008e168 or 4.2e17 < y Initial program 71.6%
*-commutative71.6%
Simplified71.6%
Taylor expanded in z around inf 61.4%
if -1.35000000000000008e168 < y < 4.2e17Initial program 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in x around inf 71.7%
Final simplification68.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1850000000.0) (not (<= z 6e-54))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1850000000.0) || !(z <= 6e-54)) {
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 <= (-1850000000.0d0)) .or. (.not. (z <= 6d-54))) 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 <= -1850000000.0) || !(z <= 6e-54)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1850000000.0) or not (z <= 6e-54): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1850000000.0) || !(z <= 6e-54)) 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 <= -1850000000.0) || ~((z <= 6e-54))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1850000000.0], N[Not[LessEqual[z, 6e-54]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1850000000 \lor \neg \left(z \leq 6 \cdot 10^{-54}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -1.85e9 or 6.00000000000000018e-54 < z Initial program 74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in z around inf 56.9%
if -1.85e9 < z < 6.00000000000000018e-54Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 58.1%
Final simplification57.4%
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
return x / t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x / t
end function
public static double code(double x, double y, double z, double t, double a) {
return x / t;
}
def code(x, y, z, t, a): return x / t
function code(x, y, z, t, a) return Float64(x / t) end
function tmp = code(x, y, z, t, a) tmp = x / t; end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t}
\end{array}
Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in z around 0 32.9%
(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 2024143
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< z -32113435955957344) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 4392440296622287/125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (- x (* y z)) (/ 1 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))))))
(/ (- x (* y z)) (- t (* a z))))