
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ z b) (* t (/ (/ x b) y))))
(t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 (- INFINITY))
(/ y (/ (* t (fma y (/ b t) (+ a 1.0))) z))
(if (<= t_2 -2e-314)
t_2
(if (<= t_2 0.0)
t_1
(if (<= t_2 1e+297)
t_2
(if (<= t_2 INFINITY)
(* (/ y t) (/ z (+ 1.0 (fma y (/ b t) a))))
t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + (t * ((x / b) / y));
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = y / ((t * fma(y, (b / t), (a + 1.0))) / z);
} else if (t_2 <= -2e-314) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 1e+297) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = (y / t) * (z / (1.0 + fma(y, (b / t), a)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y))) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(y / Float64(Float64(t * fma(y, Float64(b / t), Float64(a + 1.0))) / z)); elseif (t_2 <= -2e-314) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 1e+297) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(Float64(y / t) * Float64(z / Float64(1.0 + fma(y, Float64(b / t), a)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(y / N[(N[(t * N[(y * N[(b / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e-314], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 1e+297], t$95$2, If[LessEqual[t$95$2, Infinity], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{y}{\frac{t \cdot \mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}{z}}\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-314}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 10^{+297}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 38.5%
*-commutative38.5%
associate-*l/48.2%
*-commutative48.2%
associate-*l/48.2%
Simplified48.2%
Taylor expanded in x around 0 71.3%
associate-/l*90.1%
associate-+r+90.1%
+-commutative90.1%
associate-/l*49.2%
+-commutative49.2%
associate-/r/90.1%
*-commutative90.1%
fma-udef90.1%
+-commutative90.1%
Simplified90.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.9999999999e-314 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1e297Initial program 99.5%
if -1.9999999999e-314 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 31.8%
*-commutative31.8%
associate-*l/32.0%
*-commutative32.0%
associate-*l/42.4%
Simplified42.4%
Taylor expanded in b around inf 30.3%
associate-/l*30.4%
*-commutative30.4%
+-commutative30.4%
associate-*r/30.6%
fma-udef30.6%
Simplified30.6%
fma-udef30.6%
*-commutative30.6%
Applied egg-rr30.6%
Taylor expanded in t around 0 77.6%
associate-*r/79.3%
associate-/r*83.4%
Simplified83.4%
if 1e297 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 5.6%
*-commutative5.6%
associate-*l/27.1%
*-commutative27.1%
associate-*l/27.1%
Simplified27.1%
Taylor expanded in x around 0 57.2%
times-frac89.0%
associate-/l*89.0%
+-commutative89.0%
associate-/r/88.8%
*-commutative88.8%
fma-def88.8%
Simplified88.8%
Final simplification94.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ z b) (* t (/ (/ x b) y))))
(t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_3 (* (/ y t) (/ z (+ 1.0 (fma y (/ b t) a))))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -2e-314)
t_2
(if (<= t_2 0.0)
t_1
(if (<= t_2 1e+297) t_2 (if (<= t_2 INFINITY) t_3 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + (t * ((x / b) / y));
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_3 = (y / t) * (z / (1.0 + fma(y, (b / t), a)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -2e-314) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 1e+297) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y))) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_3 = Float64(Float64(y / t) * Float64(z / Float64(1.0 + fma(y, Float64(b / t), a)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -2e-314) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 1e+297) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -2e-314], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 1e+297], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_3 := \frac{y}{t} \cdot \frac{z}{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-314}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 10^{+297}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0 or 1e297 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 28.3%
*-commutative28.3%
associate-*l/41.6%
*-commutative41.6%
associate-*l/41.6%
Simplified41.6%
Taylor expanded in x around 0 66.9%
times-frac80.1%
associate-/l*65.5%
+-commutative65.5%
associate-/r/80.0%
*-commutative80.0%
fma-def80.0%
Simplified80.0%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.9999999999e-314 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1e297Initial program 99.5%
if -1.9999999999e-314 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 31.8%
*-commutative31.8%
associate-*l/32.0%
*-commutative32.0%
associate-*l/42.4%
Simplified42.4%
Taylor expanded in b around inf 30.3%
associate-/l*30.4%
*-commutative30.4%
+-commutative30.4%
associate-*r/30.6%
fma-udef30.6%
Simplified30.6%
fma-udef30.6%
*-commutative30.6%
Applied egg-rr30.6%
Taylor expanded in t around 0 77.6%
associate-*r/79.3%
associate-/r*83.4%
Simplified83.4%
Final simplification93.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* y b) t)) (t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) t_1))))
(if (<= t_2 (- INFINITY))
(/ (* y z) (* t (+ 1.0 (+ a t_1))))
(if (or (<= t_2 -2e-314) (and (not (<= t_2 0.0)) (<= t_2 1e+297)))
t_2
(+ (/ z b) (* t (/ (/ x b) y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (y * z) / (t * (1.0 + (a + t_1)));
} else if ((t_2 <= -2e-314) || (!(t_2 <= 0.0) && (t_2 <= 1e+297))) {
tmp = t_2;
} else {
tmp = (z / b) + (t * ((x / b) / y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (y * z) / (t * (1.0 + (a + t_1)));
} else if ((t_2 <= -2e-314) || (!(t_2 <= 0.0) && (t_2 <= 1e+297))) {
tmp = t_2;
} else {
tmp = (z / b) + (t * ((x / b) / y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1) tmp = 0 if t_2 <= -math.inf: tmp = (y * z) / (t * (1.0 + (a + t_1))) elif (t_2 <= -2e-314) or (not (t_2 <= 0.0) and (t_2 <= 1e+297)): tmp = t_2 else: tmp = (z / b) + (t * ((x / b) / y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + t_1)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(y * z) / Float64(t * Float64(1.0 + Float64(a + t_1)))); elseif ((t_2 <= -2e-314) || (!(t_2 <= 0.0) && (t_2 <= 1e+297))) tmp = t_2; else tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1); tmp = 0.0; if (t_2 <= -Inf) tmp = (y * z) / (t * (1.0 + (a + t_1))); elseif ((t_2 <= -2e-314) || (~((t_2 <= 0.0)) && (t_2 <= 1e+297))) tmp = t_2; else tmp = (z / b) + (t * ((x / b) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y * z), $MachinePrecision] / N[(t * N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$2, -2e-314], And[N[Not[LessEqual[t$95$2, 0.0]], $MachinePrecision], LessEqual[t$95$2, 1e+297]]], t$95$2, N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + t_1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{y \cdot z}{t \cdot \left(1 + \left(a + t_1\right)\right)}\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-314} \lor \neg \left(t_2 \leq 0\right) \land t_2 \leq 10^{+297}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 38.5%
*-commutative38.5%
associate-*l/48.2%
*-commutative48.2%
associate-*l/48.2%
Simplified48.2%
Taylor expanded in x around 0 71.3%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.9999999999e-314 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1e297Initial program 99.5%
if -1.9999999999e-314 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0 or 1e297 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 28.6%
*-commutative28.6%
associate-*l/31.4%
*-commutative31.4%
associate-*l/40.5%
Simplified40.5%
Taylor expanded in b around inf 27.3%
associate-/l*27.3%
*-commutative27.3%
+-commutative27.3%
associate-*r/27.5%
fma-udef27.5%
Simplified27.5%
fma-udef27.5%
*-commutative27.5%
Applied egg-rr27.5%
Taylor expanded in t around 0 74.9%
associate-*r/75.0%
associate-/r*78.7%
Simplified78.7%
Final simplification91.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= y -8.4e-29)
(/ z b)
(if (<= y 2.6e-63)
t_1
(if (<= y 2.15e+15)
(/ x (+ 1.0 (/ (* y b) t)))
(if (<= y 2.3e+61)
(/ (+ x (* z (/ y t))) a)
(if (or (<= y 5.2e+78) (not (<= y 1e+145))) (/ z b) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (y <= -8.4e-29) {
tmp = z / b;
} else if (y <= 2.6e-63) {
tmp = t_1;
} else if (y <= 2.15e+15) {
tmp = x / (1.0 + ((y * b) / t));
} else if (y <= 2.3e+61) {
tmp = (x + (z * (y / t))) / a;
} else if ((y <= 5.2e+78) || !(y <= 1e+145)) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (a + 1.0d0)
if (y <= (-8.4d-29)) then
tmp = z / b
else if (y <= 2.6d-63) then
tmp = t_1
else if (y <= 2.15d+15) then
tmp = x / (1.0d0 + ((y * b) / t))
else if (y <= 2.3d+61) then
tmp = (x + (z * (y / t))) / a
else if ((y <= 5.2d+78) .or. (.not. (y <= 1d+145))) then
tmp = z / b
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 b) {
double t_1 = x / (a + 1.0);
double tmp;
if (y <= -8.4e-29) {
tmp = z / b;
} else if (y <= 2.6e-63) {
tmp = t_1;
} else if (y <= 2.15e+15) {
tmp = x / (1.0 + ((y * b) / t));
} else if (y <= 2.3e+61) {
tmp = (x + (z * (y / t))) / a;
} else if ((y <= 5.2e+78) || !(y <= 1e+145)) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if y <= -8.4e-29: tmp = z / b elif y <= 2.6e-63: tmp = t_1 elif y <= 2.15e+15: tmp = x / (1.0 + ((y * b) / t)) elif y <= 2.3e+61: tmp = (x + (z * (y / t))) / a elif (y <= 5.2e+78) or not (y <= 1e+145): tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (y <= -8.4e-29) tmp = Float64(z / b); elseif (y <= 2.6e-63) tmp = t_1; elseif (y <= 2.15e+15) tmp = Float64(x / Float64(1.0 + Float64(Float64(y * b) / t))); elseif (y <= 2.3e+61) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / a); elseif ((y <= 5.2e+78) || !(y <= 1e+145)) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a + 1.0); tmp = 0.0; if (y <= -8.4e-29) tmp = z / b; elseif (y <= 2.6e-63) tmp = t_1; elseif (y <= 2.15e+15) tmp = x / (1.0 + ((y * b) / t)); elseif (y <= 2.3e+61) tmp = (x + (z * (y / t))) / a; elseif ((y <= 5.2e+78) || ~((y <= 1e+145))) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.4e-29], N[(z / b), $MachinePrecision], If[LessEqual[y, 2.6e-63], t$95$1, If[LessEqual[y, 2.15e+15], N[(x / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+61], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[Or[LessEqual[y, 5.2e+78], N[Not[LessEqual[y, 1e+145]], $MachinePrecision]], N[(z / b), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;y \leq -8.4 \cdot 10^{-29}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+61}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+78} \lor \neg \left(y \leq 10^{+145}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -8.39999999999999958e-29 or 2.3e61 < y < 5.2e78 or 9.9999999999999999e144 < y Initial program 52.4%
*-commutative52.4%
associate-*l/55.0%
*-commutative55.0%
associate-*l/60.0%
Simplified60.0%
Taylor expanded in t around 0 63.3%
if -8.39999999999999958e-29 < y < 2.6000000000000001e-63 or 5.2e78 < y < 9.9999999999999999e144Initial program 93.1%
*-commutative93.1%
associate-*l/87.6%
*-commutative87.6%
associate-*l/84.2%
Simplified84.2%
Taylor expanded in t around inf 67.1%
if 2.6000000000000001e-63 < y < 2.15e15Initial program 93.3%
*-commutative93.3%
associate-*l/93.4%
*-commutative93.4%
associate-*l/93.5%
Simplified93.5%
Taylor expanded in x around inf 67.5%
expm1-log1p-u32.7%
expm1-udef32.7%
log1p-udef32.7%
add-exp-log67.5%
associate-/l*67.3%
Applied egg-rr67.3%
associate--l+67.1%
Simplified67.1%
Taylor expanded in a around 0 60.1%
if 2.15e15 < y < 2.3e61Initial program 81.2%
associate-/l*81.2%
associate-+l+81.2%
associate-/l*81.2%
Simplified81.2%
associate-/r/81.2%
Applied egg-rr81.2%
Taylor expanded in a around inf 80.5%
Final simplification65.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.55e-21)
(+ (/ z b) (* t (/ (/ x b) y)))
(if (<= y -7.5e-257)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= y 9e+145) (/ 1.0 (/ (+ 1.0 (+ a (/ b (/ t y)))) x)) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.55e-21) {
tmp = (z / b) + (t * ((x / b) / y));
} else if (y <= -7.5e-257) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 9e+145) {
tmp = 1.0 / ((1.0 + (a + (b / (t / y)))) / x);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if (y <= (-1.55d-21)) then
tmp = (z / b) + (t * ((x / b) / y))
else if (y <= (-7.5d-257)) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (y <= 9d+145) then
tmp = 1.0d0 / ((1.0d0 + (a + (b / (t / y)))) / x)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.55e-21) {
tmp = (z / b) + (t * ((x / b) / y));
} else if (y <= -7.5e-257) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 9e+145) {
tmp = 1.0 / ((1.0 + (a + (b / (t / y)))) / x);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.55e-21: tmp = (z / b) + (t * ((x / b) / y)) elif y <= -7.5e-257: tmp = (x + ((y * z) / t)) / (a + 1.0) elif y <= 9e+145: tmp = 1.0 / ((1.0 + (a + (b / (t / y)))) / x) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.55e-21) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y))); elseif (y <= -7.5e-257) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (y <= 9e+145) tmp = Float64(1.0 / Float64(Float64(1.0 + Float64(a + Float64(b / Float64(t / y)))) / x)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.55e-21) tmp = (z / b) + (t * ((x / b) / y)); elseif (y <= -7.5e-257) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (y <= 9e+145) tmp = 1.0 / ((1.0 + (a + (b / (t / y)))) / x); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.55e-21], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.5e-257], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+145], N[(1.0 / N[(N[(1.0 + N[(a + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-21}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-257}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+145}:\\
\;\;\;\;\frac{1}{\frac{1 + \left(a + \frac{b}{\frac{t}{y}}\right)}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.5499999999999999e-21Initial program 56.1%
*-commutative56.1%
associate-*l/58.8%
*-commutative58.8%
associate-*l/62.7%
Simplified62.7%
Taylor expanded in b around inf 36.8%
associate-/l*34.4%
*-commutative34.4%
+-commutative34.4%
associate-*r/34.6%
fma-udef34.6%
Simplified34.6%
fma-udef34.6%
*-commutative34.6%
Applied egg-rr34.6%
Taylor expanded in t around 0 69.1%
associate-*r/70.3%
associate-/r*70.2%
Simplified70.2%
if -1.5499999999999999e-21 < y < -7.4999999999999995e-257Initial program 91.9%
*-commutative91.9%
associate-*l/82.0%
*-commutative82.0%
associate-*l/75.9%
Simplified75.9%
Taylor expanded in b around 0 75.3%
if -7.4999999999999995e-257 < y < 8.9999999999999996e145Initial program 93.4%
*-commutative93.4%
associate-*l/91.5%
*-commutative91.5%
associate-*l/90.5%
Simplified90.5%
Taylor expanded in x around inf 78.5%
clear-num78.3%
inv-pow78.3%
associate-/l*79.4%
Applied egg-rr79.4%
unpow-179.4%
Simplified79.4%
if 8.9999999999999996e145 < y Initial program 39.6%
*-commutative39.6%
associate-*l/42.3%
*-commutative42.3%
associate-*l/50.1%
Simplified50.1%
Taylor expanded in t around 0 65.0%
Final simplification73.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.9e-192) (not (<= t 1.7e-183))) (/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b))))) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.9e-192) || !(t <= 1.7e-183)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((t <= (-3.9d-192)) .or. (.not. (t <= 1.7d-183))) then
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (y / (t / b))))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.9e-192) || !(t <= 1.7e-183)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.9e-192) or not (t <= 1.7e-183): tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.9e-192) || !(t <= 1.7e-183)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.9e-192) || ~((t <= 1.7e-183))) tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.9e-192], N[Not[LessEqual[t, 1.7e-183]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{-192} \lor \neg \left(t \leq 1.7 \cdot 10^{-183}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -3.9000000000000003e-192 or 1.70000000000000007e-183 < t Initial program 81.3%
associate-/l*82.0%
associate-+l+82.0%
associate-/l*84.0%
Simplified84.0%
associate-/r/84.1%
Applied egg-rr84.1%
if -3.9000000000000003e-192 < t < 1.70000000000000007e-183Initial program 45.3%
*-commutative45.3%
associate-*l/36.0%
*-commutative36.0%
associate-*l/32.2%
Simplified32.2%
Taylor expanded in t around 0 81.6%
Final simplification83.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.45e-183)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t 1.8e-183)
(/ z b)
(/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.45e-183) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t <= 1.8e-183) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if (t <= (-1.45d-183)) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else if (t <= 1.8d-183) then
tmp = z / b
else
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (y / (t / b))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.45e-183) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t <= 1.8e-183) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.45e-183: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t <= 1.8e-183: tmp = z / b else: tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.45e-183) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t <= 1.8e-183) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.45e-183) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t <= 1.8e-183) tmp = z / b; else tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.45e-183], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e-183], N[(z / b), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-183}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-183}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\end{array}
\end{array}
if t < -1.45e-183Initial program 82.3%
*-commutative82.3%
associate-*l/84.6%
*-commutative84.6%
associate-*l/84.6%
Simplified84.6%
if -1.45e-183 < t < 1.8000000000000001e-183Initial program 45.3%
*-commutative45.3%
associate-*l/36.0%
*-commutative36.0%
associate-*l/32.2%
Simplified32.2%
Taylor expanded in t around 0 81.6%
if 1.8000000000000001e-183 < t Initial program 80.4%
associate-/l*79.9%
associate-+l+79.9%
associate-/l*83.5%
Simplified83.5%
associate-/r/85.0%
Applied egg-rr85.0%
Final simplification84.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (+ 1.0 (/ y (/ t b))))))
(if (<= t -1.55e-192)
(/ (+ x (/ y (/ t z))) t_1)
(if (<= t 2.5e-184) (/ z b) (/ (+ x (* z (/ y t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (1.0 + (y / (t / b)));
double tmp;
if (t <= -1.55e-192) {
tmp = (x + (y / (t / z))) / t_1;
} else if (t <= 2.5e-184) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a + (1.0d0 + (y / (t / b)))
if (t <= (-1.55d-192)) then
tmp = (x + (y / (t / z))) / t_1
else if (t <= 2.5d-184) then
tmp = z / b
else
tmp = (x + (z * (y / t))) / t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (1.0 + (y / (t / b)));
double tmp;
if (t <= -1.55e-192) {
tmp = (x + (y / (t / z))) / t_1;
} else if (t <= 2.5e-184) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + (1.0 + (y / (t / b))) tmp = 0 if t <= -1.55e-192: tmp = (x + (y / (t / z))) / t_1 elif t <= 2.5e-184: tmp = z / b else: tmp = (x + (z * (y / t))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(1.0 + Float64(y / Float64(t / b)))) tmp = 0.0 if (t <= -1.55e-192) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / t_1); elseif (t <= 2.5e-184) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + (1.0 + (y / (t / b))); tmp = 0.0; if (t <= -1.55e-192) tmp = (x + (y / (t / z))) / t_1; elseif (t <= 2.5e-184) tmp = z / b; else tmp = (x + (z * (y / t))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.55e-192], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t, 2.5e-184], N[(z / b), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \left(1 + \frac{y}{\frac{t}{b}}\right)\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{-192}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{t_1}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-184}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{t_1}\\
\end{array}
\end{array}
if t < -1.55e-192Initial program 82.3%
associate-/l*84.5%
associate-+l+84.5%
associate-/l*84.6%
Simplified84.6%
if -1.55e-192 < t < 2.50000000000000001e-184Initial program 45.3%
*-commutative45.3%
associate-*l/36.0%
*-commutative36.0%
associate-*l/32.2%
Simplified32.2%
Taylor expanded in t around 0 81.6%
if 2.50000000000000001e-184 < t Initial program 80.4%
associate-/l*79.9%
associate-+l+79.9%
associate-/l*83.5%
Simplified83.5%
associate-/r/85.0%
Applied egg-rr85.0%
Final simplification84.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.3e-22)
(+ (/ z b) (* t (/ (/ x b) y)))
(if (<= y -6e-253)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= y 2e+145) (/ x (+ (+ a 1.0) (* y (/ b t)))) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.3e-22) {
tmp = (z / b) + (t * ((x / b) / y));
} else if (y <= -6e-253) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 2e+145) {
tmp = x / ((a + 1.0) + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if (y <= (-3.3d-22)) then
tmp = (z / b) + (t * ((x / b) / y))
else if (y <= (-6d-253)) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (y <= 2d+145) then
tmp = x / ((a + 1.0d0) + (y * (b / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.3e-22) {
tmp = (z / b) + (t * ((x / b) / y));
} else if (y <= -6e-253) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 2e+145) {
tmp = x / ((a + 1.0) + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.3e-22: tmp = (z / b) + (t * ((x / b) / y)) elif y <= -6e-253: tmp = (x + ((y * z) / t)) / (a + 1.0) elif y <= 2e+145: tmp = x / ((a + 1.0) + (y * (b / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.3e-22) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y))); elseif (y <= -6e-253) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (y <= 2e+145) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.3e-22) tmp = (z / b) + (t * ((x / b) / y)); elseif (y <= -6e-253) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (y <= 2e+145) tmp = x / ((a + 1.0) + (y * (b / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.3e-22], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6e-253], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+145], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-22}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-253}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+145}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -3.3000000000000001e-22Initial program 56.1%
*-commutative56.1%
associate-*l/58.8%
*-commutative58.8%
associate-*l/62.7%
Simplified62.7%
Taylor expanded in b around inf 36.8%
associate-/l*34.4%
*-commutative34.4%
+-commutative34.4%
associate-*r/34.6%
fma-udef34.6%
Simplified34.6%
fma-udef34.6%
*-commutative34.6%
Applied egg-rr34.6%
Taylor expanded in t around 0 69.1%
associate-*r/70.3%
associate-/r*70.2%
Simplified70.2%
if -3.3000000000000001e-22 < y < -6.0000000000000004e-253Initial program 91.3%
*-commutative91.3%
associate-*l/80.8%
*-commutative80.8%
associate-*l/74.3%
Simplified74.3%
Taylor expanded in b around 0 73.7%
if -6.0000000000000004e-253 < y < 2e145Initial program 93.6%
*-commutative93.6%
associate-*l/91.8%
*-commutative91.8%
associate-*l/90.8%
Simplified90.8%
Taylor expanded in x around inf 79.1%
if 2e145 < y Initial program 39.6%
*-commutative39.6%
associate-*l/42.3%
*-commutative42.3%
associate-*l/50.1%
Simplified50.1%
Taylor expanded in t around 0 65.0%
Final simplification73.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.6e-21)
(+ (/ z b) (* t (/ (/ x b) y)))
(if (<= y -6.5e-253)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= y 7e+148) (/ x (+ 1.0 (+ a (* b (/ y t))))) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e-21) {
tmp = (z / b) + (t * ((x / b) / y));
} else if (y <= -6.5e-253) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 7e+148) {
tmp = x / (1.0 + (a + (b * (y / t))));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if (y <= (-1.6d-21)) then
tmp = (z / b) + (t * ((x / b) / y))
else if (y <= (-6.5d-253)) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (y <= 7d+148) then
tmp = x / (1.0d0 + (a + (b * (y / t))))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e-21) {
tmp = (z / b) + (t * ((x / b) / y));
} else if (y <= -6.5e-253) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 7e+148) {
tmp = x / (1.0 + (a + (b * (y / t))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.6e-21: tmp = (z / b) + (t * ((x / b) / y)) elif y <= -6.5e-253: tmp = (x + ((y * z) / t)) / (a + 1.0) elif y <= 7e+148: tmp = x / (1.0 + (a + (b * (y / t)))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.6e-21) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y))); elseif (y <= -6.5e-253) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (y <= 7e+148) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t))))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.6e-21) tmp = (z / b) + (t * ((x / b) / y)); elseif (y <= -6.5e-253) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (y <= 7e+148) tmp = x / (1.0 + (a + (b * (y / t)))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.6e-21], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.5e-253], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+148], N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-21}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-253}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+148}:\\
\;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.6000000000000001e-21Initial program 56.1%
*-commutative56.1%
associate-*l/58.8%
*-commutative58.8%
associate-*l/62.7%
Simplified62.7%
Taylor expanded in b around inf 36.8%
associate-/l*34.4%
*-commutative34.4%
+-commutative34.4%
associate-*r/34.6%
fma-udef34.6%
Simplified34.6%
fma-udef34.6%
*-commutative34.6%
Applied egg-rr34.6%
Taylor expanded in t around 0 69.1%
associate-*r/70.3%
associate-/r*70.2%
Simplified70.2%
if -1.6000000000000001e-21 < y < -6.4999999999999998e-253Initial program 91.3%
*-commutative91.3%
associate-*l/80.8%
*-commutative80.8%
associate-*l/74.3%
Simplified74.3%
Taylor expanded in b around 0 73.7%
if -6.4999999999999998e-253 < y < 6.9999999999999998e148Initial program 93.6%
*-commutative93.6%
associate-*l/91.8%
*-commutative91.8%
associate-*l/90.8%
Simplified90.8%
Taylor expanded in x around inf 79.1%
*-un-lft-identity79.1%
times-frac80.1%
Applied egg-rr80.1%
if 6.9999999999999998e148 < y Initial program 39.6%
*-commutative39.6%
associate-*l/42.3%
*-commutative42.3%
associate-*l/50.1%
Simplified50.1%
Taylor expanded in t around 0 65.0%
Final simplification73.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= y -2.05e-22)
(/ z b)
(if (<= y 5.5e-62)
t_1
(if (<= y 24.0) (* t (/ (/ x b) y)) (if (<= y 3.5e+19) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (y <= -2.05e-22) {
tmp = z / b;
} else if (y <= 5.5e-62) {
tmp = t_1;
} else if (y <= 24.0) {
tmp = t * ((x / b) / y);
} else if (y <= 3.5e+19) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (a + 1.0d0)
if (y <= (-2.05d-22)) then
tmp = z / b
else if (y <= 5.5d-62) then
tmp = t_1
else if (y <= 24.0d0) then
tmp = t * ((x / b) / y)
else if (y <= 3.5d+19) then
tmp = t_1
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (y <= -2.05e-22) {
tmp = z / b;
} else if (y <= 5.5e-62) {
tmp = t_1;
} else if (y <= 24.0) {
tmp = t * ((x / b) / y);
} else if (y <= 3.5e+19) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if y <= -2.05e-22: tmp = z / b elif y <= 5.5e-62: tmp = t_1 elif y <= 24.0: tmp = t * ((x / b) / y) elif y <= 3.5e+19: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (y <= -2.05e-22) tmp = Float64(z / b); elseif (y <= 5.5e-62) tmp = t_1; elseif (y <= 24.0) tmp = Float64(t * Float64(Float64(x / b) / y)); elseif (y <= 3.5e+19) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a + 1.0); tmp = 0.0; if (y <= -2.05e-22) tmp = z / b; elseif (y <= 5.5e-62) tmp = t_1; elseif (y <= 24.0) tmp = t * ((x / b) / y); elseif (y <= 3.5e+19) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.05e-22], N[(z / b), $MachinePrecision], If[LessEqual[y, 5.5e-62], t$95$1, If[LessEqual[y, 24.0], N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+19], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;y \leq -2.05 \cdot 10^{-22}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 24:\\
\;\;\;\;t \cdot \frac{\frac{x}{b}}{y}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.05e-22 or 3.5e19 < y Initial program 53.5%
*-commutative53.5%
associate-*l/56.5%
*-commutative56.5%
associate-*l/61.7%
Simplified61.7%
Taylor expanded in t around 0 59.7%
if -2.05e-22 < y < 5.50000000000000022e-62 or 24 < y < 3.5e19Initial program 96.3%
*-commutative96.3%
associate-*l/89.8%
*-commutative89.8%
associate-*l/85.5%
Simplified85.5%
Taylor expanded in t around inf 68.4%
if 5.50000000000000022e-62 < y < 24Initial program 90.3%
*-commutative90.3%
associate-*l/90.3%
*-commutative90.3%
associate-*l/90.3%
Simplified90.3%
Taylor expanded in x around inf 60.7%
expm1-log1p-u19.4%
expm1-udef19.4%
log1p-udef19.4%
add-exp-log60.7%
associate-/l*60.4%
Applied egg-rr60.4%
associate--l+60.1%
Simplified60.1%
Taylor expanded in b around inf 48.8%
associate-*r/50.0%
associate-/r*50.0%
Simplified50.0%
Final simplification63.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.95e-28)
(/ z b)
(if (<= y 1.3e-63)
(/ x (+ a 1.0))
(if (<= y 2.3e+135) (/ x (+ 1.0 (/ b (/ t y)))) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.95e-28) {
tmp = z / b;
} else if (y <= 1.3e-63) {
tmp = x / (a + 1.0);
} else if (y <= 2.3e+135) {
tmp = x / (1.0 + (b / (t / y)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if (y <= (-1.95d-28)) then
tmp = z / b
else if (y <= 1.3d-63) then
tmp = x / (a + 1.0d0)
else if (y <= 2.3d+135) then
tmp = x / (1.0d0 + (b / (t / y)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.95e-28) {
tmp = z / b;
} else if (y <= 1.3e-63) {
tmp = x / (a + 1.0);
} else if (y <= 2.3e+135) {
tmp = x / (1.0 + (b / (t / y)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.95e-28: tmp = z / b elif y <= 1.3e-63: tmp = x / (a + 1.0) elif y <= 2.3e+135: tmp = x / (1.0 + (b / (t / y))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.95e-28) tmp = Float64(z / b); elseif (y <= 1.3e-63) tmp = Float64(x / Float64(a + 1.0)); elseif (y <= 2.3e+135) tmp = Float64(x / Float64(1.0 + Float64(b / Float64(t / y)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.95e-28) tmp = z / b; elseif (y <= 1.3e-63) tmp = x / (a + 1.0); elseif (y <= 2.3e+135) tmp = x / (1.0 + (b / (t / y))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.95e-28], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.3e-63], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+135], N[(x / N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{-28}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-63}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+135}:\\
\;\;\;\;\frac{x}{1 + \frac{b}{\frac{t}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.94999999999999999e-28 or 2.3000000000000001e135 < y Initial program 51.2%
*-commutative51.2%
associate-*l/54.7%
*-commutative54.7%
associate-*l/59.7%
Simplified59.7%
Taylor expanded in t around 0 63.0%
if -1.94999999999999999e-28 < y < 1.3000000000000001e-63Initial program 96.1%
*-commutative96.1%
associate-*l/89.1%
*-commutative89.1%
associate-*l/84.6%
Simplified84.6%
Taylor expanded in t around inf 68.6%
if 1.3000000000000001e-63 < y < 2.3000000000000001e135Initial program 84.3%
*-commutative84.3%
associate-*l/84.3%
*-commutative84.3%
associate-*l/87.4%
Simplified87.4%
Taylor expanded in x around inf 54.6%
Taylor expanded in a around 0 43.3%
associate-/l*45.5%
Simplified45.5%
Final simplification63.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.4e-27) (not (<= y 4.6e-62))) (+ (/ z b) (* t (/ (/ x b) y))) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.4e-27) || !(y <= 4.6e-62)) {
tmp = (z / b) + (t * ((x / b) / y));
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.4d-27)) .or. (.not. (y <= 4.6d-62))) then
tmp = (z / b) + (t * ((x / b) / y))
else
tmp = x / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.4e-27) || !(y <= 4.6e-62)) {
tmp = (z / b) + (t * ((x / b) / y));
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.4e-27) or not (y <= 4.6e-62): tmp = (z / b) + (t * ((x / b) / y)) else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.4e-27) || !(y <= 4.6e-62)) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y))); else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.4e-27) || ~((y <= 4.6e-62))) tmp = (z / b) + (t * ((x / b) / y)); else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.4e-27], N[Not[LessEqual[y, 4.6e-62]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-27} \lor \neg \left(y \leq 4.6 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -1.4e-27 or 4.60000000000000001e-62 < y Initial program 57.8%
*-commutative57.8%
associate-*l/60.6%
*-commutative60.6%
associate-*l/65.2%
Simplified65.2%
Taylor expanded in b around inf 36.2%
associate-/l*35.0%
*-commutative35.0%
+-commutative35.0%
associate-*r/35.1%
fma-udef35.1%
Simplified35.1%
fma-udef35.1%
*-commutative35.1%
Applied egg-rr35.1%
Taylor expanded in t around 0 64.9%
associate-*r/65.6%
associate-/r*64.8%
Simplified64.8%
if -1.4e-27 < y < 4.60000000000000001e-62Initial program 96.1%
*-commutative96.1%
associate-*l/89.2%
*-commutative89.2%
associate-*l/84.7%
Simplified84.7%
Taylor expanded in t around inf 68.9%
Final simplification66.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -5.6e-7) (+ (/ z b) (* t (/ (/ x b) y))) (if (<= y 7e+148) (/ x (+ 1.0 (+ a (/ (* y b) t)))) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.6e-7) {
tmp = (z / b) + (t * ((x / b) / y));
} else if (y <= 7e+148) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if (y <= (-5.6d-7)) then
tmp = (z / b) + (t * ((x / b) / y))
else if (y <= 7d+148) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.6e-7) {
tmp = (z / b) + (t * ((x / b) / y));
} else if (y <= 7e+148) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -5.6e-7: tmp = (z / b) + (t * ((x / b) / y)) elif y <= 7e+148: tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.6e-7) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y))); elseif (y <= 7e+148) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -5.6e-7) tmp = (z / b) + (t * ((x / b) / y)); elseif (y <= 7e+148) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.6e-7], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+148], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{-7}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+148}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -5.60000000000000038e-7Initial program 53.1%
*-commutative53.1%
associate-*l/56.0%
*-commutative56.0%
associate-*l/60.1%
Simplified60.1%
Taylor expanded in b around inf 35.2%
associate-/l*32.7%
*-commutative32.7%
+-commutative32.7%
associate-*r/32.8%
fma-udef32.8%
Simplified32.8%
fma-udef32.8%
*-commutative32.8%
Applied egg-rr32.8%
Taylor expanded in t around 0 69.7%
associate-*r/71.0%
associate-/r*70.9%
Simplified70.9%
if -5.60000000000000038e-7 < y < 6.9999999999999998e148Initial program 93.1%
*-commutative93.1%
associate-*l/88.7%
*-commutative88.7%
associate-*l/86.0%
Simplified86.0%
Taylor expanded in x around inf 74.1%
if 6.9999999999999998e148 < y Initial program 39.6%
*-commutative39.6%
associate-*l/42.3%
*-commutative42.3%
associate-*l/50.1%
Simplified50.1%
Taylor expanded in t around 0 65.0%
Final simplification71.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3e-73) (/ z b) (if (<= y -1.06e-294) (/ x a) (if (<= y 5e-62) x (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3e-73) {
tmp = z / b;
} else if (y <= -1.06e-294) {
tmp = x / a;
} else if (y <= 5e-62) {
tmp = x;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if (y <= (-3d-73)) then
tmp = z / b
else if (y <= (-1.06d-294)) then
tmp = x / a
else if (y <= 5d-62) then
tmp = x
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3e-73) {
tmp = z / b;
} else if (y <= -1.06e-294) {
tmp = x / a;
} else if (y <= 5e-62) {
tmp = x;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3e-73: tmp = z / b elif y <= -1.06e-294: tmp = x / a elif y <= 5e-62: tmp = x else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3e-73) tmp = Float64(z / b); elseif (y <= -1.06e-294) tmp = Float64(x / a); elseif (y <= 5e-62) tmp = x; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3e-73) tmp = z / b; elseif (y <= -1.06e-294) tmp = x / a; elseif (y <= 5e-62) tmp = x; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3e-73], N[(z / b), $MachinePrecision], If[LessEqual[y, -1.06e-294], N[(x / a), $MachinePrecision], If[LessEqual[y, 5e-62], x, N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-73}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -1.06 \cdot 10^{-294}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-62}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -3e-73 or 5.0000000000000002e-62 < y Initial program 59.3%
*-commutative59.3%
associate-*l/60.7%
*-commutative60.7%
associate-*l/64.4%
Simplified64.4%
Taylor expanded in t around 0 54.7%
if -3e-73 < y < -1.0600000000000001e-294Initial program 95.7%
*-commutative95.7%
associate-*l/89.4%
*-commutative89.4%
associate-*l/83.2%
Simplified83.2%
Taylor expanded in x around inf 71.9%
Taylor expanded in a around inf 42.3%
if -1.0600000000000001e-294 < y < 5.0000000000000002e-62Initial program 99.5%
*-commutative99.5%
associate-*l/94.2%
*-commutative94.2%
associate-*l/92.3%
Simplified92.3%
Taylor expanded in x around inf 90.4%
expm1-log1p-u66.3%
expm1-udef66.3%
log1p-udef66.3%
add-exp-log90.4%
associate-/l*90.4%
Applied egg-rr90.4%
associate--l+90.4%
Simplified90.4%
Taylor expanded in b around 0 78.9%
+-commutative78.9%
Simplified78.9%
Taylor expanded in a around 0 48.4%
Final simplification51.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.26e-23) (not (<= y 5.5e-62))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.26e-23) || !(y <= 5.5e-62)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.26d-23)) .or. (.not. (y <= 5.5d-62))) then
tmp = z / b
else
tmp = x / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.26e-23) || !(y <= 5.5e-62)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.26e-23) or not (y <= 5.5e-62): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.26e-23) || !(y <= 5.5e-62)) tmp = Float64(z / b); else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.26e-23) || ~((y <= 5.5e-62))) tmp = z / b; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.26e-23], N[Not[LessEqual[y, 5.5e-62]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{-23} \lor \neg \left(y \leq 5.5 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -1.25999999999999996e-23 or 5.50000000000000022e-62 < y Initial program 57.8%
*-commutative57.8%
associate-*l/60.6%
*-commutative60.6%
associate-*l/65.2%
Simplified65.2%
Taylor expanded in t around 0 56.2%
if -1.25999999999999996e-23 < y < 5.50000000000000022e-62Initial program 96.1%
*-commutative96.1%
associate-*l/89.2%
*-commutative89.2%
associate-*l/84.7%
Simplified84.7%
Taylor expanded in t around inf 68.9%
Final simplification61.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.0) (not (<= a 7.5e-6))) (/ x a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.0) || !(a <= 7.5e-6)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.0d0)) .or. (.not. (a <= 7.5d-6))) then
tmp = x / a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.0) || !(a <= 7.5e-6)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.0) or not (a <= 7.5e-6): tmp = x / a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.0) || !(a <= 7.5e-6)) tmp = Float64(x / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.0) || ~((a <= 7.5e-6))) tmp = x / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.0], N[Not[LessEqual[a, 7.5e-6]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \lor \neg \left(a \leq 7.5 \cdot 10^{-6}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1 or 7.50000000000000019e-6 < a Initial program 74.1%
*-commutative74.1%
associate-*l/72.6%
*-commutative72.6%
associate-*l/73.4%
Simplified73.4%
Taylor expanded in x around inf 54.5%
Taylor expanded in a around inf 44.9%
if -1 < a < 7.50000000000000019e-6Initial program 73.9%
*-commutative73.9%
associate-*l/72.7%
*-commutative72.7%
associate-*l/73.5%
Simplified73.5%
Taylor expanded in x around inf 53.2%
expm1-log1p-u43.7%
expm1-udef43.7%
log1p-udef43.7%
add-exp-log53.2%
associate-/l*53.9%
Applied egg-rr53.9%
associate--l+53.9%
Simplified53.9%
Taylor expanded in b around 0 37.3%
+-commutative37.3%
Simplified37.3%
Taylor expanded in a around 0 36.8%
Final simplification40.6%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 74.0%
*-commutative74.0%
associate-*l/72.7%
*-commutative72.7%
associate-*l/73.4%
Simplified73.4%
Taylor expanded in x around inf 53.8%
expm1-log1p-u34.7%
expm1-udef34.7%
log1p-udef34.7%
add-exp-log53.8%
associate-/l*54.9%
Applied egg-rr54.9%
associate--l+54.9%
Simplified54.9%
Taylor expanded in b around 0 41.5%
+-commutative41.5%
Simplified41.5%
Taylor expanded in a around 0 21.2%
Final simplification21.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(if (< t -1.3659085366310088e-271)
t_1
(if (< t 3.036967103737246e-130) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 * ((x + ((y / t) * z)) * (1.0d0 / ((a + 1.0d0) + ((y / t) * b))))
if (t < (-1.3659085366310088d-271)) then
tmp = t_1
else if (t < 3.036967103737246d-130) then
tmp = z / b
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 b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))) tmp = 0 if t < -1.3659085366310088e-271: tmp = t_1 elif t < 3.036967103737246e-130: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 * Float64(Float64(x + Float64(Float64(y / t) * z)) * Float64(1.0 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))))) tmp = 0.0 if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))); tmp = 0.0; if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.3659085366310088e-271], t$95$1, If[Less[t, 3.036967103737246e-130], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\
\mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2024020
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))