
(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 15 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 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (* (/ y t) (/ z (fma y (/ b t) (+ a 1.0))))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -2e-300)
t_1
(if (<= t_1 0.0)
(* (/ (fma y (/ z t) x) b) (/ t y))
(if (<= t_1 1e+303) t_1 (if (<= t_1 INFINITY) t_2 (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = (y / t) * (z / fma(y, (b / t), (a + 1.0)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -2e-300) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (fma(y, (z / t), x) / b) * (t / y);
} else if (t_1 <= 1e+303) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = Float64(Float64(y / t) * Float64(z / fma(y, Float64(b / t), Float64(a + 1.0)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -2e-300) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(fma(y, Float64(z / t), x) / b) * Float64(t / y)); elseif (t_1 <= 1e+303) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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$2 = N[(N[(y / t), $MachinePrecision] * N[(z / N[(y * N[(b / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -2e-300], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / b), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \frac{y}{t} \cdot \frac{z}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-300}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{b} \cdot \frac{t}{y}\\
\mathbf{elif}\;t_1 \leq 10^{+303}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\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 1e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 45.2%
*-commutative45.2%
associate-*l/62.4%
+-rgt-identity62.4%
associate-+l+62.4%
associate-+r+62.4%
+-rgt-identity62.4%
*-commutative62.4%
associate-*l/62.1%
Simplified62.1%
Taylor expanded in x around 0 67.6%
times-frac91.1%
associate-+r+91.1%
+-commutative91.1%
*-commutative91.1%
associate-*r/85.2%
+-commutative85.2%
fma-udef85.2%
+-commutative85.2%
Simplified85.2%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.00000000000000005e-300 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1e303Initial program 98.6%
if -2.00000000000000005e-300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0Initial program 59.3%
*-commutative59.3%
associate-*l/59.3%
+-rgt-identity59.3%
associate-+l+59.3%
associate-+r+59.3%
+-rgt-identity59.3%
*-commutative59.3%
associate-*l/72.8%
Simplified72.8%
associate-*l/59.3%
associate-/l*72.9%
Applied egg-rr72.9%
Taylor expanded in b around inf 49.1%
associate-/l*47.1%
*-commutative47.1%
Simplified47.1%
times-frac79.4%
*-commutative79.4%
+-commutative79.4%
div-inv79.4%
fma-def79.4%
clear-num79.4%
Applied egg-rr79.4%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 0.0%
*-commutative0.0%
associate-*l/0.5%
+-rgt-identity0.5%
associate-+l+0.5%
associate-+r+0.5%
+-rgt-identity0.5%
*-commutative0.5%
associate-*l/17.3%
Simplified17.3%
Taylor expanded in t around 0 100.0%
Final simplification93.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 -2e-300)
t_1
(if (<= t_1 0.0)
(* (/ (fma y (/ z t) x) b) (/ t y))
(if (<= t_1 1e+303) t_1 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -2e-300) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (fma(y, (z / t), x) / b) * (t / y);
} else if (t_1 <= 1e+303) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= -2e-300) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(fma(y, Float64(z / t), x) / b) * Float64(t / y)); elseif (t_1 <= 1e+303) tmp = t_1; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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$1, -2e-300], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / b), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], t$95$1, N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-300}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{b} \cdot \frac{t}{y}\\
\mathbf{elif}\;t_1 \leq 10^{+303}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.00000000000000005e-300 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1e303Initial program 94.1%
if -2.00000000000000005e-300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0Initial program 59.3%
*-commutative59.3%
associate-*l/59.3%
+-rgt-identity59.3%
associate-+l+59.3%
associate-+r+59.3%
+-rgt-identity59.3%
*-commutative59.3%
associate-*l/72.8%
Simplified72.8%
associate-*l/59.3%
associate-/l*72.9%
Applied egg-rr72.9%
Taylor expanded in b around inf 49.1%
associate-/l*47.1%
*-commutative47.1%
Simplified47.1%
times-frac79.4%
*-commutative79.4%
+-commutative79.4%
div-inv79.4%
fma-def79.4%
clear-num79.4%
Applied egg-rr79.4%
if 1e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 22.0%
*-commutative22.0%
associate-*l/31.2%
+-rgt-identity31.2%
associate-+l+31.2%
associate-+r+31.2%
+-rgt-identity31.2%
*-commutative31.2%
associate-*l/40.1%
Simplified40.1%
Taylor expanded in t around 0 79.4%
Final simplification88.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 -4e-295)
t_1
(if (<= t_1 1e-114)
(/ (+ x (* y (/ z t))) (+ a (+ 1.0 (/ b (/ t y)))))
(if (<= t_1 INFINITY)
(/ (+ 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 t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -4e-295) {
tmp = t_1;
} else if (t_1 <= 1e-114) {
tmp = (x + (y * (z / t))) / (a + (1.0 + (b / (t / y))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -4e-295) {
tmp = t_1;
} else if (t_1 <= 1e-114) {
tmp = (x + (y * (z / t))) / (a + (1.0 + (b / (t / y))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
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): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_1 <= -4e-295: tmp = t_1 elif t_1 <= 1e-114: tmp = (x + (y * (z / t))) / (a + (1.0 + (b / (t / y)))) elif t_1 <= math.inf: 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) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= -4e-295) tmp = t_1; elseif (t_1 <= 1e-114) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))); elseif (t_1 <= Inf) 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) t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= -4e-295) tmp = t_1; elseif (t_1 <= 1e-114) tmp = (x + (y * (z / t))) / (a + (1.0 + (b / (t / y)))); elseif (t_1 <= Inf) 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_] := Block[{t$95$1 = 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$1, -4e-295], t$95$1, If[LessEqual[t$95$1, 1e-114], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], 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}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{-295}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 10^{-114}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\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 (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -4.00000000000000024e-295Initial program 90.5%
if -4.00000000000000024e-295 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.0000000000000001e-114Initial program 70.5%
*-commutative70.5%
associate-*l/71.8%
+-rgt-identity71.8%
associate-+l+71.8%
associate-+r+71.8%
+-rgt-identity71.8%
*-commutative71.8%
associate-*l/75.9%
Simplified75.9%
associate-*l/71.8%
associate-/l*81.2%
Applied egg-rr81.2%
if 1.0000000000000001e-114 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 85.2%
associate-/l*86.6%
+-rgt-identity86.6%
associate-+l+86.6%
associate-+r+86.6%
+-rgt-identity86.6%
associate-/l*86.6%
Simplified86.6%
associate-/r/88.9%
Applied egg-rr88.9%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 0.0%
*-commutative0.0%
associate-*l/0.5%
+-rgt-identity0.5%
associate-+l+0.5%
associate-+r+0.5%
+-rgt-identity0.5%
*-commutative0.5%
associate-*l/17.3%
Simplified17.3%
Taylor expanded in t around 0 100.0%
Final simplification88.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ z b) (* t (/ (/ x y) b))))
(t_2 (/ (+ x (* y (/ z t))) (+ a 1.0))))
(if (<= b -1.16e+134)
(+ (/ z b) (* t (/ x (* y b))))
(if (<= b 390000000000.0)
t_2
(if (<= b 2.35e+88)
t_1
(if (<= b 4.1e+103)
t_2
(if (<= b 6e+205)
t_1
(if (<= b 2.8e+288)
(/ x (+ a (+ 1.0 (* b (/ y t)))))
(/ z b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + (t * ((x / y) / b));
double t_2 = (x + (y * (z / t))) / (a + 1.0);
double tmp;
if (b <= -1.16e+134) {
tmp = (z / b) + (t * (x / (y * b)));
} else if (b <= 390000000000.0) {
tmp = t_2;
} else if (b <= 2.35e+88) {
tmp = t_1;
} else if (b <= 4.1e+103) {
tmp = t_2;
} else if (b <= 6e+205) {
tmp = t_1;
} else if (b <= 2.8e+288) {
tmp = x / (a + (1.0 + (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z / b) + (t * ((x / y) / b))
t_2 = (x + (y * (z / t))) / (a + 1.0d0)
if (b <= (-1.16d+134)) then
tmp = (z / b) + (t * (x / (y * b)))
else if (b <= 390000000000.0d0) then
tmp = t_2
else if (b <= 2.35d+88) then
tmp = t_1
else if (b <= 4.1d+103) then
tmp = t_2
else if (b <= 6d+205) then
tmp = t_1
else if (b <= 2.8d+288) then
tmp = x / (a + (1.0d0 + (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 t_1 = (z / b) + (t * ((x / y) / b));
double t_2 = (x + (y * (z / t))) / (a + 1.0);
double tmp;
if (b <= -1.16e+134) {
tmp = (z / b) + (t * (x / (y * b)));
} else if (b <= 390000000000.0) {
tmp = t_2;
} else if (b <= 2.35e+88) {
tmp = t_1;
} else if (b <= 4.1e+103) {
tmp = t_2;
} else if (b <= 6e+205) {
tmp = t_1;
} else if (b <= 2.8e+288) {
tmp = x / (a + (1.0 + (b * (y / t))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z / b) + (t * ((x / y) / b)) t_2 = (x + (y * (z / t))) / (a + 1.0) tmp = 0 if b <= -1.16e+134: tmp = (z / b) + (t * (x / (y * b))) elif b <= 390000000000.0: tmp = t_2 elif b <= 2.35e+88: tmp = t_1 elif b <= 4.1e+103: tmp = t_2 elif b <= 6e+205: tmp = t_1 elif b <= 2.8e+288: tmp = x / (a + (1.0 + (b * (y / t)))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / y) / b))) t_2 = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)) tmp = 0.0 if (b <= -1.16e+134) tmp = Float64(Float64(z / b) + Float64(t * Float64(x / Float64(y * b)))); elseif (b <= 390000000000.0) tmp = t_2; elseif (b <= 2.35e+88) tmp = t_1; elseif (b <= 4.1e+103) tmp = t_2; elseif (b <= 6e+205) tmp = t_1; elseif (b <= 2.8e+288) tmp = Float64(x / Float64(a + Float64(1.0 + Float64(b * Float64(y / t))))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z / b) + (t * ((x / y) / b)); t_2 = (x + (y * (z / t))) / (a + 1.0); tmp = 0.0; if (b <= -1.16e+134) tmp = (z / b) + (t * (x / (y * b))); elseif (b <= 390000000000.0) tmp = t_2; elseif (b <= 2.35e+88) tmp = t_1; elseif (b <= 4.1e+103) tmp = t_2; elseif (b <= 6e+205) tmp = t_1; elseif (b <= 2.8e+288) tmp = x / (a + (1.0 + (b * (y / t)))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.16e+134], N[(N[(z / b), $MachinePrecision] + N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 390000000000.0], t$95$2, If[LessEqual[b, 2.35e+88], t$95$1, If[LessEqual[b, 4.1e+103], t$95$2, If[LessEqual[b, 6e+205], t$95$1, If[LessEqual[b, 2.8e+288], N[(x / N[(a + N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{b} + t \cdot \frac{\frac{x}{y}}{b}\\
t_2 := \frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\mathbf{if}\;b \leq -1.16 \cdot 10^{+134}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{x}{y \cdot b}\\
\mathbf{elif}\;b \leq 390000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 2.35 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 4.1 \cdot 10^{+103}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+205}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{+288}:\\
\;\;\;\;\frac{x}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if b < -1.16e134Initial program 61.9%
*-commutative61.9%
associate-*l/63.6%
+-rgt-identity63.6%
associate-+l+63.6%
associate-+r+63.6%
+-rgt-identity63.6%
*-commutative63.6%
associate-*l/51.7%
Simplified51.7%
Taylor expanded in t around 0 65.9%
Taylor expanded in x around inf 66.2%
*-commutative66.2%
associate-*r/70.9%
Simplified70.9%
if -1.16e134 < b < 3.9e11 or 2.35000000000000004e88 < b < 4.1000000000000002e103Initial program 83.6%
*-commutative83.6%
associate-*l/86.0%
+-rgt-identity86.0%
associate-+l+86.0%
associate-+r+86.0%
+-rgt-identity86.0%
*-commutative86.0%
associate-*l/86.6%
Simplified86.6%
Taylor expanded in b around 0 76.3%
if 3.9e11 < b < 2.35000000000000004e88 or 4.1000000000000002e103 < b < 5.9999999999999999e205Initial program 54.5%
*-commutative54.5%
associate-*l/45.9%
+-rgt-identity45.9%
associate-+l+45.9%
associate-+r+45.9%
+-rgt-identity45.9%
*-commutative45.9%
associate-*l/57.5%
Simplified57.5%
Taylor expanded in t around 0 62.0%
Taylor expanded in x around inf 66.6%
*-commutative66.6%
associate-*r/71.5%
associate-/r*80.2%
Simplified80.2%
if 5.9999999999999999e205 < b < 2.7999999999999998e288Initial program 89.3%
*-commutative89.3%
associate-*l/89.3%
+-rgt-identity89.3%
associate-+l+89.3%
associate-+r+89.3%
+-rgt-identity89.3%
*-commutative89.3%
associate-*l/89.4%
Simplified89.4%
associate-*l/89.3%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 79.8%
+-commutative79.8%
*-commutative79.8%
associate-+r+79.8%
+-commutative79.8%
associate-*l/90.3%
*-commutative90.3%
Simplified90.3%
if 2.7999999999999998e288 < b Initial program 1.7%
*-commutative1.7%
associate-*l/0.7%
+-rgt-identity0.7%
associate-+l+0.7%
associate-+r+0.7%
+-rgt-identity0.7%
*-commutative0.7%
associate-*l/20.0%
Simplified20.0%
Taylor expanded in t around 0 80.7%
Final simplification77.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= (+ a 1.0) -4e+18)
(/ 1.0 (+ (/ a x) (+ (/ (/ b t) (/ x y)) (/ 1.0 x))))
(if (<= (+ a 1.0) 1600.0)
(/ (+ x (* y (/ z t))) (+ 1.0 (/ (* y b) t)))
(+ (/ x a) (* (/ z t) (/ y a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a + 1.0) <= -4e+18) {
tmp = 1.0 / ((a / x) + (((b / t) / (x / y)) + (1.0 / x)));
} else if ((a + 1.0) <= 1600.0) {
tmp = (x + (y * (z / t))) / (1.0 + ((y * b) / t));
} else {
tmp = (x / a) + ((z / t) * (y / a));
}
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) <= (-4d+18)) then
tmp = 1.0d0 / ((a / x) + (((b / t) / (x / y)) + (1.0d0 / x)))
else if ((a + 1.0d0) <= 1600.0d0) then
tmp = (x + (y * (z / t))) / (1.0d0 + ((y * b) / t))
else
tmp = (x / a) + ((z / t) * (y / a))
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) <= -4e+18) {
tmp = 1.0 / ((a / x) + (((b / t) / (x / y)) + (1.0 / x)));
} else if ((a + 1.0) <= 1600.0) {
tmp = (x + (y * (z / t))) / (1.0 + ((y * b) / t));
} else {
tmp = (x / a) + ((z / t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a + 1.0) <= -4e+18: tmp = 1.0 / ((a / x) + (((b / t) / (x / y)) + (1.0 / x))) elif (a + 1.0) <= 1600.0: tmp = (x + (y * (z / t))) / (1.0 + ((y * b) / t)) else: tmp = (x / a) + ((z / t) * (y / a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(a + 1.0) <= -4e+18) tmp = Float64(1.0 / Float64(Float64(a / x) + Float64(Float64(Float64(b / t) / Float64(x / y)) + Float64(1.0 / x)))); elseif (Float64(a + 1.0) <= 1600.0) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(Float64(y * b) / t))); else tmp = Float64(Float64(x / a) + Float64(Float64(z / t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a + 1.0) <= -4e+18) tmp = 1.0 / ((a / x) + (((b / t) / (x / y)) + (1.0 / x))); elseif ((a + 1.0) <= 1600.0) tmp = (x + (y * (z / t))) / (1.0 + ((y * b) / t)); else tmp = (x / a) + ((z / t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(a + 1.0), $MachinePrecision], -4e+18], N[(1.0 / N[(N[(a / x), $MachinePrecision] + N[(N[(N[(b / t), $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a + 1.0), $MachinePrecision], 1600.0], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] + N[(N[(z / t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a + 1 \leq -4 \cdot 10^{+18}:\\
\;\;\;\;\frac{1}{\frac{a}{x} + \left(\frac{\frac{b}{t}}{\frac{x}{y}} + \frac{1}{x}\right)}\\
\mathbf{elif}\;a + 1 \leq 1600:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} + \frac{z}{t} \cdot \frac{y}{a}\\
\end{array}
\end{array}
if (+.f64 a 1) < -4e18Initial program 80.1%
*-commutative80.1%
associate-*l/83.5%
+-rgt-identity83.5%
associate-+l+83.5%
associate-+r+83.5%
+-rgt-identity83.5%
*-commutative83.5%
associate-*l/86.8%
Simplified86.8%
associate-*l/83.5%
associate-/l*85.0%
Applied egg-rr85.0%
Taylor expanded in x around inf 62.3%
+-commutative62.3%
*-commutative62.3%
associate-+r+62.3%
+-commutative62.3%
associate-*l/63.9%
*-commutative63.9%
Simplified63.9%
clear-num63.7%
inv-pow63.7%
*-commutative63.7%
associate-*l/62.1%
associate-*r/62.1%
+-commutative62.1%
fma-udef62.1%
Applied egg-rr62.1%
unpow-162.1%
Simplified62.1%
Taylor expanded in a around 0 61.9%
+-commutative61.9%
associate-+l+61.9%
times-frac68.3%
associate-*r/62.0%
associate-/l*68.4%
Simplified68.4%
if -4e18 < (+.f64 a 1) < 1600Initial program 73.3%
*-commutative73.3%
associate-*l/72.5%
+-rgt-identity72.5%
associate-+l+72.5%
associate-+r+72.5%
+-rgt-identity72.5%
*-commutative72.5%
associate-*l/74.6%
Simplified74.6%
Taylor expanded in a around 0 72.1%
if 1600 < (+.f64 a 1) Initial program 75.2%
*-commutative75.2%
associate-*l/76.7%
+-rgt-identity76.7%
associate-+l+76.7%
associate-+r+76.7%
+-rgt-identity76.7%
*-commutative76.7%
associate-*l/71.0%
Simplified71.0%
Taylor expanded in a around inf 66.8%
Taylor expanded in x around 0 64.9%
times-frac71.2%
Simplified71.2%
Final simplification71.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.02e-125) (not (<= t 6.2e-150))) (/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b))))) (+ (/ z b) (/ (* x t) (* y b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.02e-125) || !(t <= 6.2e-150)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else {
tmp = (z / b) + ((x * t) / (y * 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.02d-125)) .or. (.not. (t <= 6.2d-150))) then
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (y / (t / b))))
else
tmp = (z / b) + ((x * t) / (y * 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.02e-125) || !(t <= 6.2e-150)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.02e-125) or not (t <= 6.2e-150): tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.02e-125) || !(t <= 6.2e-150)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); else tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.02e-125) || ~((t <= 6.2e-150))) tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.02e-125], N[Not[LessEqual[t, 6.2e-150]], $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[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{-125} \lor \neg \left(t \leq 6.2 \cdot 10^{-150}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -1.02e-125 or 6.19999999999999996e-150 < t Initial program 81.6%
associate-/l*83.2%
+-rgt-identity83.2%
associate-+l+83.2%
associate-+r+83.2%
+-rgt-identity83.2%
associate-/l*87.7%
Simplified87.7%
associate-/r/88.7%
Applied egg-rr88.7%
if -1.02e-125 < t < 6.19999999999999996e-150Initial program 57.3%
*-commutative57.3%
associate-*l/55.5%
+-rgt-identity55.5%
associate-+l+55.5%
associate-+r+55.5%
+-rgt-identity55.5%
*-commutative55.5%
associate-*l/45.3%
Simplified45.3%
Taylor expanded in t around 0 53.4%
Taylor expanded in x around inf 73.9%
Final simplification84.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -7.5e-229)
(/ (+ x (* y (/ z t))) (+ a (+ 1.0 (* y (/ b t)))))
(if (<= t 7e-150)
(+ (/ z b) (/ (* x t) (* y 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 <= -7.5e-229) {
tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t))));
} else if (t <= 7e-150) {
tmp = (z / b) + ((x * t) / (y * 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 <= (-7.5d-229)) then
tmp = (x + (y * (z / t))) / (a + (1.0d0 + (y * (b / t))))
else if (t <= 7d-150) then
tmp = (z / b) + ((x * t) / (y * 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 <= -7.5e-229) {
tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t))));
} else if (t <= 7e-150) {
tmp = (z / b) + ((x * t) / (y * 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 <= -7.5e-229: tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))) elif t <= 7e-150: tmp = (z / b) + ((x * t) / (y * 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 <= -7.5e-229) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + Float64(1.0 + Float64(y * Float64(b / t))))); elseif (t <= 7e-150) tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * 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 <= -7.5e-229) tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))); elseif (t <= 7e-150) tmp = (z / b) + ((x * t) / (y * 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, -7.5e-229], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-150], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $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 -7.5 \cdot 10^{-229}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-150}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot 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 < -7.4999999999999999e-229Initial program 84.7%
*-commutative84.7%
associate-*l/84.7%
+-rgt-identity84.7%
associate-+l+84.7%
associate-+r+84.7%
+-rgt-identity84.7%
*-commutative84.7%
associate-*l/84.7%
Simplified84.7%
if -7.4999999999999999e-229 < t < 6.9999999999999996e-150Initial program 51.6%
*-commutative51.6%
associate-*l/48.9%
+-rgt-identity48.9%
associate-+l+48.9%
associate-+r+48.9%
+-rgt-identity48.9%
*-commutative48.9%
associate-*l/38.4%
Simplified38.4%
Taylor expanded in t around 0 61.1%
Taylor expanded in x around inf 79.8%
if 6.9999999999999996e-150 < t Initial program 76.2%
associate-/l*79.2%
+-rgt-identity79.2%
associate-+l+79.2%
associate-+r+79.2%
+-rgt-identity79.2%
associate-/l*85.8%
Simplified85.8%
associate-/r/87.6%
Applied egg-rr87.6%
Final simplification85.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* y (/ z t))) a)))
(if (<= a -1.32e+17)
t_1
(if (<= a -6.5e-111)
(/ z b)
(if (<= a -2.5e-268)
(+ x (/ y (/ t z)))
(if (<= a 1650.0) (/ x (+ 1.0 (/ (* y b) t))) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -1.32e+17) {
tmp = t_1;
} else if (a <= -6.5e-111) {
tmp = z / b;
} else if (a <= -2.5e-268) {
tmp = x + (y / (t / z));
} else if (a <= 1650.0) {
tmp = x / (1.0 + ((y * b) / t));
} 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 + (y * (z / t))) / a
if (a <= (-1.32d+17)) then
tmp = t_1
else if (a <= (-6.5d-111)) then
tmp = z / b
else if (a <= (-2.5d-268)) then
tmp = x + (y / (t / z))
else if (a <= 1650.0d0) then
tmp = x / (1.0d0 + ((y * b) / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -1.32e+17) {
tmp = t_1;
} else if (a <= -6.5e-111) {
tmp = z / b;
} else if (a <= -2.5e-268) {
tmp = x + (y / (t / z));
} else if (a <= 1650.0) {
tmp = x / (1.0 + ((y * b) / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (y * (z / t))) / a tmp = 0 if a <= -1.32e+17: tmp = t_1 elif a <= -6.5e-111: tmp = z / b elif a <= -2.5e-268: tmp = x + (y / (t / z)) elif a <= 1650.0: tmp = x / (1.0 + ((y * b) / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y * Float64(z / t))) / a) tmp = 0.0 if (a <= -1.32e+17) tmp = t_1; elseif (a <= -6.5e-111) tmp = Float64(z / b); elseif (a <= -2.5e-268) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (a <= 1650.0) tmp = Float64(x / Float64(1.0 + Float64(Float64(y * b) / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (y * (z / t))) / a; tmp = 0.0; if (a <= -1.32e+17) tmp = t_1; elseif (a <= -6.5e-111) tmp = z / b; elseif (a <= -2.5e-268) tmp = x + (y / (t / z)); elseif (a <= 1650.0) tmp = x / (1.0 + ((y * b) / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -1.32e+17], t$95$1, If[LessEqual[a, -6.5e-111], N[(z / b), $MachinePrecision], If[LessEqual[a, -2.5e-268], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1650.0], N[(x / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y \cdot \frac{z}{t}}{a}\\
\mathbf{if}\;a \leq -1.32 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -6.5 \cdot 10^{-111}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -2.5 \cdot 10^{-268}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;a \leq 1650:\\
\;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.32e17 or 1650 < a Initial program 77.5%
*-commutative77.5%
associate-*l/79.8%
+-rgt-identity79.8%
associate-+l+79.8%
associate-+r+79.8%
+-rgt-identity79.8%
*-commutative79.8%
associate-*l/78.3%
Simplified78.3%
Taylor expanded in a around inf 67.0%
if -1.32e17 < a < -6.49999999999999974e-111Initial program 68.5%
*-commutative68.5%
associate-*l/68.7%
+-rgt-identity68.7%
associate-+l+68.7%
associate-+r+68.7%
+-rgt-identity68.7%
*-commutative68.7%
associate-*l/77.7%
Simplified77.7%
Taylor expanded in t around 0 56.4%
if -6.49999999999999974e-111 < a < -2.5e-268Initial program 78.1%
*-commutative78.1%
associate-*l/80.8%
+-rgt-identity80.8%
associate-+l+80.8%
associate-+r+80.8%
+-rgt-identity80.8%
*-commutative80.8%
associate-*l/84.7%
Simplified84.7%
Taylor expanded in b around 0 72.7%
Taylor expanded in a around 0 72.6%
associate-/l*72.7%
Simplified72.7%
if -2.5e-268 < a < 1650Initial program 73.1%
*-commutative73.1%
associate-*l/70.9%
+-rgt-identity70.9%
associate-+l+70.9%
associate-+r+70.9%
+-rgt-identity70.9%
*-commutative70.9%
associate-*l/70.7%
Simplified70.7%
associate-*l/70.9%
associate-/l*72.1%
Applied egg-rr72.1%
Taylor expanded in x around inf 53.8%
+-commutative53.8%
*-commutative53.8%
associate-+r+53.8%
+-commutative53.8%
associate-*l/54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in a around 0 53.3%
Final simplification62.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ y (/ t z)))))
(if (<= a -14500000000000.0)
(/ t_1 a)
(if (<= a -8e-111)
(/ z b)
(if (<= a -9.5e-268)
t_1
(if (<= a 1650.0)
(/ x (+ 1.0 (/ (* y b) t)))
(/ (+ x (* y (/ z t))) a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y / (t / z));
double tmp;
if (a <= -14500000000000.0) {
tmp = t_1 / a;
} else if (a <= -8e-111) {
tmp = z / b;
} else if (a <= -9.5e-268) {
tmp = t_1;
} else if (a <= 1650.0) {
tmp = x / (1.0 + ((y * b) / t));
} else {
tmp = (x + (y * (z / t))) / a;
}
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 + (y / (t / z))
if (a <= (-14500000000000.0d0)) then
tmp = t_1 / a
else if (a <= (-8d-111)) then
tmp = z / b
else if (a <= (-9.5d-268)) then
tmp = t_1
else if (a <= 1650.0d0) then
tmp = x / (1.0d0 + ((y * b) / t))
else
tmp = (x + (y * (z / t))) / a
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 + (y / (t / z));
double tmp;
if (a <= -14500000000000.0) {
tmp = t_1 / a;
} else if (a <= -8e-111) {
tmp = z / b;
} else if (a <= -9.5e-268) {
tmp = t_1;
} else if (a <= 1650.0) {
tmp = x / (1.0 + ((y * b) / t));
} else {
tmp = (x + (y * (z / t))) / a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y / (t / z)) tmp = 0 if a <= -14500000000000.0: tmp = t_1 / a elif a <= -8e-111: tmp = z / b elif a <= -9.5e-268: tmp = t_1 elif a <= 1650.0: tmp = x / (1.0 + ((y * b) / t)) else: tmp = (x + (y * (z / t))) / a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y / Float64(t / z))) tmp = 0.0 if (a <= -14500000000000.0) tmp = Float64(t_1 / a); elseif (a <= -8e-111) tmp = Float64(z / b); elseif (a <= -9.5e-268) tmp = t_1; elseif (a <= 1650.0) tmp = Float64(x / Float64(1.0 + Float64(Float64(y * b) / t))); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y / (t / z)); tmp = 0.0; if (a <= -14500000000000.0) tmp = t_1 / a; elseif (a <= -8e-111) tmp = z / b; elseif (a <= -9.5e-268) tmp = t_1; elseif (a <= 1650.0) tmp = x / (1.0 + ((y * b) / t)); else tmp = (x + (y * (z / t))) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -14500000000000.0], N[(t$95$1 / a), $MachinePrecision], If[LessEqual[a, -8e-111], N[(z / b), $MachinePrecision], If[LessEqual[a, -9.5e-268], t$95$1, If[LessEqual[a, 1650.0], N[(x / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;a \leq -14500000000000:\\
\;\;\;\;\frac{t_1}{a}\\
\mathbf{elif}\;a \leq -8 \cdot 10^{-111}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -9.5 \cdot 10^{-268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1650:\\
\;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a}\\
\end{array}
\end{array}
if a < -1.45e13Initial program 80.1%
*-commutative80.1%
associate-*l/83.5%
+-rgt-identity83.5%
associate-+l+83.5%
associate-+r+83.5%
+-rgt-identity83.5%
*-commutative83.5%
associate-*l/86.8%
Simplified86.8%
associate-*l/83.5%
associate-/l*85.0%
Applied egg-rr85.0%
Taylor expanded in a around inf 63.8%
associate-/l*67.2%
Simplified67.2%
if -1.45e13 < a < -8.00000000000000071e-111Initial program 68.5%
*-commutative68.5%
associate-*l/68.7%
+-rgt-identity68.7%
associate-+l+68.7%
associate-+r+68.7%
+-rgt-identity68.7%
*-commutative68.7%
associate-*l/77.7%
Simplified77.7%
Taylor expanded in t around 0 56.4%
if -8.00000000000000071e-111 < a < -9.50000000000000007e-268Initial program 78.1%
*-commutative78.1%
associate-*l/80.8%
+-rgt-identity80.8%
associate-+l+80.8%
associate-+r+80.8%
+-rgt-identity80.8%
*-commutative80.8%
associate-*l/84.7%
Simplified84.7%
Taylor expanded in b around 0 72.7%
Taylor expanded in a around 0 72.6%
associate-/l*72.7%
Simplified72.7%
if -9.50000000000000007e-268 < a < 1650Initial program 73.1%
*-commutative73.1%
associate-*l/70.9%
+-rgt-identity70.9%
associate-+l+70.9%
associate-+r+70.9%
+-rgt-identity70.9%
*-commutative70.9%
associate-*l/70.7%
Simplified70.7%
associate-*l/70.9%
associate-/l*72.1%
Applied egg-rr72.1%
Taylor expanded in x around inf 53.8%
+-commutative53.8%
*-commutative53.8%
associate-+r+53.8%
+-commutative53.8%
associate-*l/54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in a around 0 53.3%
if 1650 < a Initial program 75.2%
*-commutative75.2%
associate-*l/76.7%
+-rgt-identity76.7%
associate-+l+76.7%
associate-+r+76.7%
+-rgt-identity76.7%
*-commutative76.7%
associate-*l/71.0%
Simplified71.0%
Taylor expanded in a around inf 66.8%
Final simplification62.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.8e-30) (not (<= y 3.2e-24))) (+ (/ z b) (* t (/ x (* y b)))) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.8e-30) || !(y <= 3.2e-24)) {
tmp = (z / b) + (t * (x / (y * 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 <= (-5.8d-30)) .or. (.not. (y <= 3.2d-24))) then
tmp = (z / b) + (t * (x / (y * 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 <= -5.8e-30) || !(y <= 3.2e-24)) {
tmp = (z / b) + (t * (x / (y * b)));
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.8e-30) or not (y <= 3.2e-24): tmp = (z / b) + (t * (x / (y * b))) else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.8e-30) || !(y <= 3.2e-24)) tmp = Float64(Float64(z / b) + Float64(t * Float64(x / Float64(y * 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 <= -5.8e-30) || ~((y <= 3.2e-24))) tmp = (z / b) + (t * (x / (y * b))); else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.8e-30], N[Not[LessEqual[y, 3.2e-24]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-30} \lor \neg \left(y \leq 3.2 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{x}{y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -5.79999999999999978e-30 or 3.20000000000000012e-24 < y Initial program 59.0%
*-commutative59.0%
associate-*l/62.8%
+-rgt-identity62.8%
associate-+l+62.8%
associate-+r+62.8%
+-rgt-identity62.8%
*-commutative62.8%
associate-*l/71.0%
Simplified71.0%
Taylor expanded in t around 0 46.6%
Taylor expanded in x around inf 53.6%
*-commutative53.6%
associate-*r/55.6%
Simplified55.6%
if -5.79999999999999978e-30 < y < 3.20000000000000012e-24Initial program 91.7%
*-commutative91.7%
associate-*l/89.3%
+-rgt-identity89.3%
associate-+l+89.3%
associate-+r+89.3%
+-rgt-identity89.3%
*-commutative89.3%
associate-*l/81.8%
Simplified81.8%
Taylor expanded in t around inf 68.0%
Final simplification61.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.8e-28) (not (<= y 3.8e-26))) (+ (/ z b) (* t (/ (/ x y) b))) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.8e-28) || !(y <= 3.8e-26)) {
tmp = (z / b) + (t * ((x / y) / 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 <= (-6.8d-28)) .or. (.not. (y <= 3.8d-26))) then
tmp = (z / b) + (t * ((x / y) / 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 <= -6.8e-28) || !(y <= 3.8e-26)) {
tmp = (z / b) + (t * ((x / y) / b));
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.8e-28) or not (y <= 3.8e-26): tmp = (z / b) + (t * ((x / y) / b)) else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.8e-28) || !(y <= 3.8e-26)) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / y) / 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 <= -6.8e-28) || ~((y <= 3.8e-26))) tmp = (z / b) + (t * ((x / y) / b)); else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.8e-28], N[Not[LessEqual[y, 3.8e-26]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-28} \lor \neg \left(y \leq 3.8 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -6.8000000000000001e-28 or 3.80000000000000015e-26 < y Initial program 59.0%
*-commutative59.0%
associate-*l/62.8%
+-rgt-identity62.8%
associate-+l+62.8%
associate-+r+62.8%
+-rgt-identity62.8%
*-commutative62.8%
associate-*l/71.0%
Simplified71.0%
Taylor expanded in t around 0 46.6%
Taylor expanded in x around inf 53.6%
*-commutative53.6%
associate-*r/55.6%
associate-/r*59.0%
Simplified59.0%
if -6.8000000000000001e-28 < y < 3.80000000000000015e-26Initial program 91.7%
*-commutative91.7%
associate-*l/89.3%
+-rgt-identity89.3%
associate-+l+89.3%
associate-+r+89.3%
+-rgt-identity89.3%
*-commutative89.3%
associate-*l/81.8%
Simplified81.8%
Taylor expanded in t around inf 68.0%
Final simplification63.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3e+19) (not (<= y 1.2e+51))) (+ (/ z b) (* t (/ (/ x y) b))) (/ x (+ 1.0 (+ a (/ (* y b) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3e+19) || !(y <= 1.2e+51)) {
tmp = (z / b) + (t * ((x / y) / b));
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
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+19)) .or. (.not. (y <= 1.2d+51))) then
tmp = (z / b) + (t * ((x / y) / b))
else
tmp = x / (1.0d0 + (a + ((y * b) / t)))
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+19) || !(y <= 1.2e+51)) {
tmp = (z / b) + (t * ((x / y) / b));
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3e+19) or not (y <= 1.2e+51): tmp = (z / b) + (t * ((x / y) / b)) else: tmp = x / (1.0 + (a + ((y * b) / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3e+19) || !(y <= 1.2e+51)) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / y) / b))); else tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3e+19) || ~((y <= 1.2e+51))) tmp = (z / b) + (t * ((x / y) / b)); else tmp = x / (1.0 + (a + ((y * b) / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3e+19], N[Not[LessEqual[y, 1.2e+51]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+19} \lor \neg \left(y \leq 1.2 \cdot 10^{+51}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -3e19 or 1.1999999999999999e51 < y Initial program 54.5%
*-commutative54.5%
associate-*l/58.3%
+-rgt-identity58.3%
associate-+l+58.3%
associate-+r+58.3%
+-rgt-identity58.3%
*-commutative58.3%
associate-*l/68.1%
Simplified68.1%
Taylor expanded in t around 0 48.1%
Taylor expanded in x around inf 55.3%
*-commutative55.3%
associate-*r/57.8%
associate-/r*61.7%
Simplified61.7%
if -3e19 < y < 1.1999999999999999e51Initial program 90.3%
*-commutative90.3%
associate-*l/88.8%
+-rgt-identity88.8%
associate-+l+88.8%
associate-+r+88.8%
+-rgt-identity88.8%
*-commutative88.8%
associate-*l/82.4%
Simplified82.4%
Taylor expanded in x around inf 73.0%
Final simplification68.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.1e-25) (not (<= y 5.3e-24))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.1e-25) || !(y <= 5.3e-24)) {
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 <= (-2.1d-25)) .or. (.not. (y <= 5.3d-24))) 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 <= -2.1e-25) || !(y <= 5.3e-24)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.1e-25) or not (y <= 5.3e-24): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.1e-25) || !(y <= 5.3e-24)) 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 <= -2.1e-25) || ~((y <= 5.3e-24))) 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, -2.1e-25], N[Not[LessEqual[y, 5.3e-24]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-25} \lor \neg \left(y \leq 5.3 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -2.10000000000000002e-25 or 5.29999999999999969e-24 < y Initial program 59.0%
*-commutative59.0%
associate-*l/62.8%
+-rgt-identity62.8%
associate-+l+62.8%
associate-+r+62.8%
+-rgt-identity62.8%
*-commutative62.8%
associate-*l/71.0%
Simplified71.0%
Taylor expanded in t around 0 51.0%
if -2.10000000000000002e-25 < y < 5.29999999999999969e-24Initial program 91.7%
*-commutative91.7%
associate-*l/89.3%
+-rgt-identity89.3%
associate-+l+89.3%
associate-+r+89.3%
+-rgt-identity89.3%
*-commutative89.3%
associate-*l/81.8%
Simplified81.8%
Taylor expanded in t around inf 68.0%
Final simplification59.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.8e+16) (not (<= a 2.4e+68))) (/ x a) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.8e+16) || !(a <= 2.4e+68)) {
tmp = x / a;
} 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 ((a <= (-6.8d+16)) .or. (.not. (a <= 2.4d+68))) then
tmp = x / a
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 ((a <= -6.8e+16) || !(a <= 2.4e+68)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.8e+16) or not (a <= 2.4e+68): tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.8e+16) || !(a <= 2.4e+68)) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6.8e+16) || ~((a <= 2.4e+68))) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.8e+16], N[Not[LessEqual[a, 2.4e+68]], $MachinePrecision]], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+16} \lor \neg \left(a \leq 2.4 \cdot 10^{+68}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if a < -6.8e16 or 2.40000000000000008e68 < a Initial program 77.6%
*-commutative77.6%
associate-*l/80.2%
+-rgt-identity80.2%
associate-+l+80.2%
associate-+r+80.2%
+-rgt-identity80.2%
*-commutative80.2%
associate-*l/78.6%
Simplified78.6%
Taylor expanded in t around inf 50.2%
Taylor expanded in a around inf 50.2%
if -6.8e16 < a < 2.40000000000000008e68Initial program 73.5%
*-commutative73.5%
associate-*l/72.8%
+-rgt-identity72.8%
associate-+l+72.8%
associate-+r+72.8%
+-rgt-identity72.8%
*-commutative72.8%
associate-*l/74.7%
Simplified74.7%
Taylor expanded in t around 0 45.7%
Final simplification47.7%
(FPCore (x y z t a b) :precision binary64 (/ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
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 / a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
def code(x, y, z, t, a, b): return x / a
function code(x, y, z, t, a, b) return Float64(x / a) end
function tmp = code(x, y, z, t, a, b) tmp = x / a; end
code[x_, y_, z_, t_, a_, b_] := N[(x / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a}
\end{array}
Initial program 75.3%
*-commutative75.3%
associate-*l/76.1%
+-rgt-identity76.1%
associate-+l+76.1%
associate-+r+76.1%
+-rgt-identity76.1%
*-commutative76.1%
associate-*l/76.4%
Simplified76.4%
Taylor expanded in t around inf 42.6%
Taylor expanded in a around inf 25.2%
Final simplification25.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 2023301
(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))))