
(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 12 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 (+ (+ a 1.0) (/ (* y b) t)))
(t_2 (+ x (/ (* y z) t)))
(t_3 (/ t_2 t_1))
(t_4 (/ (+ x (/ z (/ t y))) t_1)))
(if (<= t_3 -1e-317)
t_4
(if (<= t_3 2e-95)
(/ t_2 (+ (+ a 1.0) (/ y (/ t b))))
(if (<= t_3 INFINITY) t_4 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double t_2 = x + ((y * z) / t);
double t_3 = t_2 / t_1;
double t_4 = (x + (z / (t / y))) / t_1;
double tmp;
if (t_3 <= -1e-317) {
tmp = t_4;
} else if (t_3 <= 2e-95) {
tmp = t_2 / ((a + 1.0) + (y / (t / b)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} 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 = (a + 1.0) + ((y * b) / t);
double t_2 = x + ((y * z) / t);
double t_3 = t_2 / t_1;
double t_4 = (x + (z / (t / y))) / t_1;
double tmp;
if (t_3 <= -1e-317) {
tmp = t_4;
} else if (t_3 <= 2e-95) {
tmp = t_2 / ((a + 1.0) + (y / (t / b)));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + 1.0) + ((y * b) / t) t_2 = x + ((y * z) / t) t_3 = t_2 / t_1 t_4 = (x + (z / (t / y))) / t_1 tmp = 0 if t_3 <= -1e-317: tmp = t_4 elif t_3 <= 2e-95: tmp = t_2 / ((a + 1.0) + (y / (t / b))) elif t_3 <= math.inf: tmp = t_4 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)) t_2 = Float64(x + Float64(Float64(y * z) / t)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(x + Float64(z / Float64(t / y))) / t_1) tmp = 0.0 if (t_3 <= -1e-317) tmp = t_4; elseif (t_3 <= 2e-95) tmp = Float64(t_2 / Float64(Float64(a + 1.0) + Float64(y / Float64(t / b)))); elseif (t_3 <= Inf) tmp = t_4; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + 1.0) + ((y * b) / t); t_2 = x + ((y * z) / t); t_3 = t_2 / t_1; t_4 = (x + (z / (t / y))) / t_1; tmp = 0.0; if (t_3 <= -1e-317) tmp = t_4; elseif (t_3 <= 2e-95) tmp = t_2 / ((a + 1.0) + (y / (t / b))); elseif (t_3 <= Inf) tmp = t_4; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-317], t$95$4, If[LessEqual[t$95$3, 2e-95], N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$4, N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + 1\right) + \frac{y \cdot b}{t}\\
t_2 := x + \frac{y \cdot z}{t}\\
t_3 := \frac{t_2}{t_1}\\
t_4 := \frac{x + \frac{z}{\frac{t}{y}}}{t_1}\\
\mathbf{if}\;t_3 \leq -1 \cdot 10^{-317}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_3 \leq 2 \cdot 10^{-95}:\\
\;\;\;\;\frac{t_2}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t_4\\
\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))) < -1.00000023e-317 or 1.99999999999999998e-95 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 89.3%
*-commutative89.3%
associate-/l*94.0%
associate-*l/91.6%
Simplified91.6%
Taylor expanded in y around 0 94.0%
if -1.00000023e-317 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.99999999999999998e-95Initial program 72.6%
associate-/l*80.7%
Simplified80.7%
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.0%
associate-*l/0.3%
Simplified0.3%
Taylor expanded in t around 0 100.0%
Final simplification91.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* z (/ y t))) (+ a 1.0))))
(if (<= t -3600.0)
t_1
(if (<= t -2.0865e-138)
(/ z b)
(if (<= t -9.2e-268)
(/ (* y z) (* t (+ 1.0 (+ a (/ (* y b) t)))))
(if (<= t 6.2e-60) (/ (* y z) (+ t (* y b))) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z * (y / t))) / (a + 1.0);
double tmp;
if (t <= -3600.0) {
tmp = t_1;
} else if (t <= -2.0865e-138) {
tmp = z / b;
} else if (t <= -9.2e-268) {
tmp = (y * z) / (t * (1.0 + (a + ((y * b) / t))));
} else if (t <= 6.2e-60) {
tmp = (y * z) / (t + (y * 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 + (z * (y / t))) / (a + 1.0d0)
if (t <= (-3600.0d0)) then
tmp = t_1
else if (t <= (-2.0865d-138)) then
tmp = z / b
else if (t <= (-9.2d-268)) then
tmp = (y * z) / (t * (1.0d0 + (a + ((y * b) / t))))
else if (t <= 6.2d-60) then
tmp = (y * z) / (t + (y * 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 + (z * (y / t))) / (a + 1.0);
double tmp;
if (t <= -3600.0) {
tmp = t_1;
} else if (t <= -2.0865e-138) {
tmp = z / b;
} else if (t <= -9.2e-268) {
tmp = (y * z) / (t * (1.0 + (a + ((y * b) / t))));
} else if (t <= 6.2e-60) {
tmp = (y * z) / (t + (y * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (z * (y / t))) / (a + 1.0) tmp = 0 if t <= -3600.0: tmp = t_1 elif t <= -2.0865e-138: tmp = z / b elif t <= -9.2e-268: tmp = (y * z) / (t * (1.0 + (a + ((y * b) / t)))) elif t <= 6.2e-60: tmp = (y * z) / (t + (y * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)) tmp = 0.0 if (t <= -3600.0) tmp = t_1; elseif (t <= -2.0865e-138) tmp = Float64(z / b); elseif (t <= -9.2e-268) tmp = Float64(Float64(y * z) / Float64(t * Float64(1.0 + Float64(a + Float64(Float64(y * b) / t))))); elseif (t <= 6.2e-60) tmp = Float64(Float64(y * z) / Float64(t + Float64(y * b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (z * (y / t))) / (a + 1.0); tmp = 0.0; if (t <= -3600.0) tmp = t_1; elseif (t <= -2.0865e-138) tmp = z / b; elseif (t <= -9.2e-268) tmp = (y * z) / (t * (1.0 + (a + ((y * b) / t)))); elseif (t <= 6.2e-60) tmp = (y * z) / (t + (y * b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3600.0], t$95$1, If[LessEqual[t, -2.0865e-138], N[(z / b), $MachinePrecision], If[LessEqual[t, -9.2e-268], N[(N[(y * z), $MachinePrecision] / N[(t * N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e-60], N[(N[(y * z), $MachinePrecision] / N[(t + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\mathbf{if}\;t \leq -3600:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.0865 \cdot 10^{-138}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-268}:\\
\;\;\;\;\frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{y \cdot b}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-60}:\\
\;\;\;\;\frac{y \cdot z}{t + y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3600 or 6.19999999999999976e-60 < t Initial program 86.6%
*-commutative86.6%
associate-/l*93.0%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in y around 0 93.0%
Taylor expanded in b around 0 77.4%
+-commutative77.4%
associate-/l*81.5%
associate-/r/83.2%
Simplified83.2%
if -3600 < t < -2.08649999999999994e-138Initial program 61.8%
*-commutative61.8%
associate-/l*64.5%
associate-*l/64.4%
Simplified64.4%
Taylor expanded in t around 0 54.0%
if -2.08649999999999994e-138 < t < -9.20000000000000042e-268Initial program 71.0%
*-commutative71.0%
associate-/l*60.1%
associate-*l/56.0%
Simplified56.0%
Taylor expanded in x around 0 71.2%
if -9.20000000000000042e-268 < t < 6.19999999999999976e-60Initial program 67.8%
+-commutative67.8%
associate-*l/56.7%
fma-def56.7%
associate-+l+56.7%
+-commutative56.7%
associate-*l/49.8%
fma-def49.8%
Simplified49.8%
Taylor expanded in a around 0 61.3%
Taylor expanded in z around inf 57.4%
Taylor expanded in y around 0 72.5%
Final simplification76.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.4e+173) (not (<= y 1.75e+214))) (/ z b) (/ (+ x (* z (/ y t))) (+ (+ a 1.0) (* b (/ y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.4e+173) || !(y <= 1.75e+214)) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / 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 <= (-8.4d+173)) .or. (.not. (y <= 1.75d+214))) then
tmp = z / b
else
tmp = (x + (z * (y / t))) / ((a + 1.0d0) + (b * (y / 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 <= -8.4e+173) || !(y <= 1.75e+214)) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.4e+173) or not (y <= 1.75e+214): tmp = z / b else: tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.4e+173) || !(y <= 1.75e+214)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -8.4e+173) || ~((y <= 1.75e+214))) tmp = z / b; else tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.4e+173], N[Not[LessEqual[y, 1.75e+214]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.4 \cdot 10^{+173} \lor \neg \left(y \leq 1.75 \cdot 10^{+214}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\end{array}
\end{array}
if y < -8.40000000000000001e173 or 1.75e214 < y Initial program 49.1%
*-commutative49.1%
associate-/l*47.1%
associate-*l/45.9%
Simplified45.9%
Taylor expanded in t around 0 72.3%
if -8.40000000000000001e173 < y < 1.75e214Initial program 86.4%
*-commutative86.4%
associate-/l*88.2%
associate-*l/88.5%
Simplified88.5%
div-inv88.5%
clear-num88.5%
Applied egg-rr88.5%
Final simplification85.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.3e+156)
(/ z b)
(if (<= y 3.7e+76)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= y 3.3e+166)
(/ (* y z) (+ t (* y b)))
(if (<= y 2.6e+209) (* (+ x (/ y (/ t z))) (/ 1.0 a)) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.3e+156) {
tmp = z / b;
} else if (y <= 3.7e+76) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 3.3e+166) {
tmp = (y * z) / (t + (y * b));
} else if (y <= 2.6e+209) {
tmp = (x + (y / (t / z))) * (1.0 / 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 (y <= (-2.3d+156)) then
tmp = z / b
else if (y <= 3.7d+76) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (y <= 3.3d+166) then
tmp = (y * z) / (t + (y * b))
else if (y <= 2.6d+209) then
tmp = (x + (y / (t / z))) * (1.0d0 / 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 (y <= -2.3e+156) {
tmp = z / b;
} else if (y <= 3.7e+76) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 3.3e+166) {
tmp = (y * z) / (t + (y * b));
} else if (y <= 2.6e+209) {
tmp = (x + (y / (t / z))) * (1.0 / a);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.3e+156: tmp = z / b elif y <= 3.7e+76: tmp = x / (1.0 + (a + ((y * b) / t))) elif y <= 3.3e+166: tmp = (y * z) / (t + (y * b)) elif y <= 2.6e+209: tmp = (x + (y / (t / z))) * (1.0 / a) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.3e+156) tmp = Float64(z / b); elseif (y <= 3.7e+76) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (y <= 3.3e+166) tmp = Float64(Float64(y * z) / Float64(t + Float64(y * b))); elseif (y <= 2.6e+209) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) * Float64(1.0 / a)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.3e+156) tmp = z / b; elseif (y <= 3.7e+76) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (y <= 3.3e+166) tmp = (y * z) / (t + (y * b)); elseif (y <= 2.6e+209) tmp = (x + (y / (t / z))) * (1.0 / a); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.3e+156], N[(z / b), $MachinePrecision], If[LessEqual[y, 3.7e+76], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e+166], N[(N[(y * z), $MachinePrecision] / N[(t + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+209], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / a), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+156}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+76}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+166}:\\
\;\;\;\;\frac{y \cdot z}{t + y \cdot b}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+209}:\\
\;\;\;\;\left(x + \frac{y}{\frac{t}{z}}\right) \cdot \frac{1}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.2999999999999999e156 or 2.6e209 < y Initial program 48.5%
*-commutative48.5%
associate-/l*46.5%
associate-*l/47.1%
Simplified47.1%
Taylor expanded in t around 0 70.5%
if -2.2999999999999999e156 < y < 3.6999999999999999e76Initial program 90.8%
*-commutative90.8%
associate-/l*90.0%
associate-*l/89.9%
Simplified89.9%
Taylor expanded in x around inf 68.3%
if 3.6999999999999999e76 < y < 3.3000000000000002e166Initial program 73.0%
+-commutative73.0%
associate-*l/78.1%
fma-def78.1%
associate-+l+78.1%
+-commutative78.1%
associate-*l/78.0%
fma-def78.0%
Simplified78.0%
Taylor expanded in a around 0 62.6%
Taylor expanded in z around inf 62.9%
Taylor expanded in y around 0 62.9%
if 3.3000000000000002e166 < y < 2.6e209Initial program 55.2%
*-commutative55.2%
associate-/l*90.2%
associate-*l/90.3%
Simplified90.3%
Taylor expanded in a around inf 29.3%
div-inv29.1%
+-commutative29.1%
associate-/l*55.5%
Applied egg-rr55.5%
Final simplification67.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.55e+175)
(/ z b)
(if (<= y 1.65e+75)
(/ x (+ (+ a 1.0) (* b (/ y t))))
(if (<= y 9.5e+166)
(/ (* y z) (+ t (* y b)))
(if (<= y 2.55e+209) (* (+ x (/ y (/ t z))) (/ 1.0 a)) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.55e+175) {
tmp = z / b;
} else if (y <= 1.65e+75) {
tmp = x / ((a + 1.0) + (b * (y / t)));
} else if (y <= 9.5e+166) {
tmp = (y * z) / (t + (y * b));
} else if (y <= 2.55e+209) {
tmp = (x + (y / (t / z))) * (1.0 / 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 (y <= (-2.55d+175)) then
tmp = z / b
else if (y <= 1.65d+75) then
tmp = x / ((a + 1.0d0) + (b * (y / t)))
else if (y <= 9.5d+166) then
tmp = (y * z) / (t + (y * b))
else if (y <= 2.55d+209) then
tmp = (x + (y / (t / z))) * (1.0d0 / 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 (y <= -2.55e+175) {
tmp = z / b;
} else if (y <= 1.65e+75) {
tmp = x / ((a + 1.0) + (b * (y / t)));
} else if (y <= 9.5e+166) {
tmp = (y * z) / (t + (y * b));
} else if (y <= 2.55e+209) {
tmp = (x + (y / (t / z))) * (1.0 / a);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.55e+175: tmp = z / b elif y <= 1.65e+75: tmp = x / ((a + 1.0) + (b * (y / t))) elif y <= 9.5e+166: tmp = (y * z) / (t + (y * b)) elif y <= 2.55e+209: tmp = (x + (y / (t / z))) * (1.0 / a) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.55e+175) tmp = Float64(z / b); elseif (y <= 1.65e+75) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); elseif (y <= 9.5e+166) tmp = Float64(Float64(y * z) / Float64(t + Float64(y * b))); elseif (y <= 2.55e+209) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) * Float64(1.0 / a)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.55e+175) tmp = z / b; elseif (y <= 1.65e+75) tmp = x / ((a + 1.0) + (b * (y / t))); elseif (y <= 9.5e+166) tmp = (y * z) / (t + (y * b)); elseif (y <= 2.55e+209) tmp = (x + (y / (t / z))) * (1.0 / a); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.55e+175], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.65e+75], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+166], N[(N[(y * z), $MachinePrecision] / N[(t + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.55e+209], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / a), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.55 \cdot 10^{+175}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+75}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+166}:\\
\;\;\;\;\frac{y \cdot z}{t + y \cdot b}\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{+209}:\\
\;\;\;\;\left(x + \frac{y}{\frac{t}{z}}\right) \cdot \frac{1}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.55000000000000003e175 or 2.55000000000000011e209 < y Initial program 49.1%
*-commutative49.1%
associate-/l*47.1%
associate-*l/45.9%
Simplified45.9%
Taylor expanded in t around 0 72.3%
if -2.55000000000000003e175 < y < 1.64999999999999999e75Initial program 89.8%
*-commutative89.8%
associate-/l*89.1%
associate-*l/89.5%
Simplified89.5%
Taylor expanded in x around inf 67.7%
if 1.64999999999999999e75 < y < 9.49999999999999984e166Initial program 73.0%
+-commutative73.0%
associate-*l/78.1%
fma-def78.1%
associate-+l+78.1%
+-commutative78.1%
associate-*l/78.0%
fma-def78.0%
Simplified78.0%
Taylor expanded in a around 0 62.6%
Taylor expanded in z around inf 62.9%
Taylor expanded in y around 0 62.9%
if 9.49999999999999984e166 < y < 2.55000000000000011e209Initial program 55.2%
*-commutative55.2%
associate-/l*90.2%
associate-*l/90.3%
Simplified90.3%
Taylor expanded in a around inf 29.3%
div-inv29.1%
+-commutative29.1%
associate-/l*55.5%
Applied egg-rr55.5%
Final simplification67.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -130000.0) (not (<= a 2.8e+25))) (/ (+ x (* z (/ y t))) (+ a 1.0)) (/ (+ x (/ (* y z) t)) (+ 1.0 (* y (/ b t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -130000.0) || !(a <= 2.8e+25)) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else {
tmp = (x + ((y * z) / t)) / (1.0 + (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 ((a <= (-130000.0d0)) .or. (.not. (a <= 2.8d+25))) then
tmp = (x + (z * (y / t))) / (a + 1.0d0)
else
tmp = (x + ((y * z) / t)) / (1.0d0 + (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 ((a <= -130000.0) || !(a <= 2.8e+25)) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else {
tmp = (x + ((y * z) / t)) / (1.0 + (y * (b / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -130000.0) or not (a <= 2.8e+25): tmp = (x + (z * (y / t))) / (a + 1.0) else: tmp = (x + ((y * z) / t)) / (1.0 + (y * (b / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -130000.0) || !(a <= 2.8e+25)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(1.0 + Float64(y * Float64(b / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -130000.0) || ~((a <= 2.8e+25))) tmp = (x + (z * (y / t))) / (a + 1.0); else tmp = (x + ((y * z) / t)) / (1.0 + (y * (b / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -130000.0], N[Not[LessEqual[a, 2.8e+25]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -130000 \lor \neg \left(a \leq 2.8 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{1 + y \cdot \frac{b}{t}}\\
\end{array}
\end{array}
if a < -1.3e5 or 2.8000000000000002e25 < a Initial program 77.9%
*-commutative77.9%
associate-/l*79.5%
associate-*l/80.2%
Simplified80.2%
Taylor expanded in y around 0 79.5%
Taylor expanded in b around 0 65.4%
+-commutative65.4%
associate-/l*67.4%
associate-/r/69.6%
Simplified69.6%
if -1.3e5 < a < 2.8000000000000002e25Initial program 78.8%
+-commutative78.8%
associate-*l/79.1%
fma-def79.1%
associate-+l+79.1%
+-commutative79.1%
associate-*l/78.7%
fma-def78.7%
Simplified78.7%
Taylor expanded in a around 0 77.3%
associate-/l*77.1%
div-inv77.1%
Applied egg-rr77.1%
associate-*r/77.1%
*-rgt-identity77.1%
associate-/l*77.3%
associate-*r/77.1%
Simplified77.1%
Final simplification73.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -130000.0) (not (<= a 2.95e+25))) (/ (+ x (* z (/ y t))) (+ a 1.0)) (/ (+ x (/ (* y z) t)) (+ 1.0 (/ (* y b) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -130000.0) || !(a <= 2.95e+25)) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else {
tmp = (x + ((y * z) / t)) / (1.0 + ((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 ((a <= (-130000.0d0)) .or. (.not. (a <= 2.95d+25))) then
tmp = (x + (z * (y / t))) / (a + 1.0d0)
else
tmp = (x + ((y * z) / t)) / (1.0d0 + ((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 ((a <= -130000.0) || !(a <= 2.95e+25)) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else {
tmp = (x + ((y * z) / t)) / (1.0 + ((y * b) / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -130000.0) or not (a <= 2.95e+25): tmp = (x + (z * (y / t))) / (a + 1.0) else: tmp = (x + ((y * z) / t)) / (1.0 + ((y * b) / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -130000.0) || !(a <= 2.95e+25)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(1.0 + Float64(Float64(y * b) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -130000.0) || ~((a <= 2.95e+25))) tmp = (x + (z * (y / t))) / (a + 1.0); else tmp = (x + ((y * z) / t)) / (1.0 + ((y * b) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -130000.0], N[Not[LessEqual[a, 2.95e+25]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -130000 \lor \neg \left(a \leq 2.95 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{1 + \frac{y \cdot b}{t}}\\
\end{array}
\end{array}
if a < -1.3e5 or 2.95e25 < a Initial program 77.9%
*-commutative77.9%
associate-/l*79.5%
associate-*l/80.2%
Simplified80.2%
Taylor expanded in y around 0 79.5%
Taylor expanded in b around 0 65.4%
+-commutative65.4%
associate-/l*67.4%
associate-/r/69.6%
Simplified69.6%
if -1.3e5 < a < 2.95e25Initial program 78.8%
+-commutative78.8%
associate-*l/79.1%
fma-def79.1%
associate-+l+79.1%
+-commutative79.1%
associate-*l/78.7%
fma-def78.7%
Simplified78.7%
Taylor expanded in a around 0 77.3%
Final simplification73.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ 1.0 (/ 1.0 x))))
(if (<= a -1.65e+98)
(/ x a)
(if (<= a -9.5e-99)
(/ z b)
(if (<= a -2.75e-127)
t_1
(if (<= a 4.1e-277)
(/ z b)
(if (<= a 1e-42) t_1 (if (<= a 9.8e+25) (/ z b) (/ x a)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 / (1.0 / x);
double tmp;
if (a <= -1.65e+98) {
tmp = x / a;
} else if (a <= -9.5e-99) {
tmp = z / b;
} else if (a <= -2.75e-127) {
tmp = t_1;
} else if (a <= 4.1e-277) {
tmp = z / b;
} else if (a <= 1e-42) {
tmp = t_1;
} else if (a <= 9.8e+25) {
tmp = z / b;
} else {
tmp = x / 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 = 1.0d0 / (1.0d0 / x)
if (a <= (-1.65d+98)) then
tmp = x / a
else if (a <= (-9.5d-99)) then
tmp = z / b
else if (a <= (-2.75d-127)) then
tmp = t_1
else if (a <= 4.1d-277) then
tmp = z / b
else if (a <= 1d-42) then
tmp = t_1
else if (a <= 9.8d+25) then
tmp = z / b
else
tmp = x / 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 = 1.0 / (1.0 / x);
double tmp;
if (a <= -1.65e+98) {
tmp = x / a;
} else if (a <= -9.5e-99) {
tmp = z / b;
} else if (a <= -2.75e-127) {
tmp = t_1;
} else if (a <= 4.1e-277) {
tmp = z / b;
} else if (a <= 1e-42) {
tmp = t_1;
} else if (a <= 9.8e+25) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 / (1.0 / x) tmp = 0 if a <= -1.65e+98: tmp = x / a elif a <= -9.5e-99: tmp = z / b elif a <= -2.75e-127: tmp = t_1 elif a <= 4.1e-277: tmp = z / b elif a <= 1e-42: tmp = t_1 elif a <= 9.8e+25: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 / Float64(1.0 / x)) tmp = 0.0 if (a <= -1.65e+98) tmp = Float64(x / a); elseif (a <= -9.5e-99) tmp = Float64(z / b); elseif (a <= -2.75e-127) tmp = t_1; elseif (a <= 4.1e-277) tmp = Float64(z / b); elseif (a <= 1e-42) tmp = t_1; elseif (a <= 9.8e+25) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 / (1.0 / x); tmp = 0.0; if (a <= -1.65e+98) tmp = x / a; elseif (a <= -9.5e-99) tmp = z / b; elseif (a <= -2.75e-127) tmp = t_1; elseif (a <= 4.1e-277) tmp = z / b; elseif (a <= 1e-42) tmp = t_1; elseif (a <= 9.8e+25) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.65e+98], N[(x / a), $MachinePrecision], If[LessEqual[a, -9.5e-99], N[(z / b), $MachinePrecision], If[LessEqual[a, -2.75e-127], t$95$1, If[LessEqual[a, 4.1e-277], N[(z / b), $MachinePrecision], If[LessEqual[a, 1e-42], t$95$1, If[LessEqual[a, 9.8e+25], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{1}{x}}\\
\mathbf{if}\;a \leq -1.65 \cdot 10^{+98}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -9.5 \cdot 10^{-99}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -2.75 \cdot 10^{-127}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{-277}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 9.8 \cdot 10^{+25}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1.65000000000000014e98 or 9.8000000000000002e25 < a Initial program 79.4%
*-commutative79.4%
associate-/l*80.4%
associate-*l/81.3%
Simplified81.3%
Taylor expanded in x around inf 60.7%
Taylor expanded in a around inf 54.8%
if -1.65000000000000014e98 < a < -9.5000000000000008e-99 or -2.75000000000000018e-127 < a < 4.09999999999999989e-277 or 1.00000000000000004e-42 < a < 9.8000000000000002e25Initial program 76.6%
*-commutative76.6%
associate-/l*77.9%
associate-*l/77.3%
Simplified77.3%
Taylor expanded in t around 0 48.4%
if -9.5000000000000008e-99 < a < -2.75000000000000018e-127 or 4.09999999999999989e-277 < a < 1.00000000000000004e-42Initial program 80.5%
*-commutative80.5%
associate-/l*80.4%
associate-*l/80.4%
Simplified80.4%
Taylor expanded in x around inf 59.4%
clear-num59.3%
inv-pow59.3%
associate-+l+59.3%
+-commutative59.3%
fma-def59.3%
Applied egg-rr59.3%
unpow-159.3%
Simplified59.3%
Taylor expanded in a around 0 59.3%
Taylor expanded in y around 0 49.7%
Final simplification51.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3600.0) (not (<= t 6.2e-60))) (/ (+ x (* z (/ y t))) (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3600.0) || !(t <= 6.2e-60)) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} 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 <= (-3600.0d0)) .or. (.not. (t <= 6.2d-60))) then
tmp = (x + (z * (y / t))) / (a + 1.0d0)
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 <= -3600.0) || !(t <= 6.2e-60)) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3600.0) or not (t <= 6.2e-60): tmp = (x + (z * (y / t))) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3600.0) || !(t <= 6.2e-60)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3600.0) || ~((t <= 6.2e-60))) tmp = (x + (z * (y / t))) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3600.0], N[Not[LessEqual[t, 6.2e-60]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3600 \lor \neg \left(t \leq 6.2 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -3600 or 6.19999999999999976e-60 < t Initial program 86.6%
*-commutative86.6%
associate-/l*93.0%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in y around 0 93.0%
Taylor expanded in b around 0 77.4%
+-commutative77.4%
associate-/l*81.5%
associate-/r/83.2%
Simplified83.2%
if -3600 < t < 6.19999999999999976e-60Initial program 66.8%
*-commutative66.8%
associate-/l*59.9%
associate-*l/55.9%
Simplified55.9%
Taylor expanded in t around 0 60.5%
Final simplification73.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.2e+18) (not (<= t 6.8e-60))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.2e+18) || !(t <= 6.8e-60)) {
tmp = x / (a + 1.0);
} 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.2d+18)) .or. (.not. (t <= 6.8d-60))) then
tmp = x / (a + 1.0d0)
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.2e+18) || !(t <= 6.8e-60)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.2e+18) or not (t <= 6.8e-60): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.2e+18) || !(t <= 6.8e-60)) tmp = Float64(x / Float64(a + 1.0)); 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.2e+18) || ~((t <= 6.8e-60))) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.2e+18], N[Not[LessEqual[t, 6.8e-60]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+18} \lor \neg \left(t \leq 6.8 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -3.2e18 or 6.80000000000000013e-60 < t Initial program 86.7%
*-commutative86.7%
associate-/l*93.4%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in t around inf 62.7%
if -3.2e18 < t < 6.80000000000000013e-60Initial program 67.7%
*-commutative67.7%
associate-/l*61.2%
associate-*l/57.4%
Simplified57.4%
Taylor expanded in t around 0 59.2%
Final simplification61.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.06e+99) (/ x a) (if (<= a 6.8e+26) (/ z b) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.06e+99) {
tmp = x / a;
} else if (a <= 6.8e+26) {
tmp = z / b;
} else {
tmp = x / 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.06d+99)) then
tmp = x / a
else if (a <= 6.8d+26) then
tmp = z / b
else
tmp = x / 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.06e+99) {
tmp = x / a;
} else if (a <= 6.8e+26) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.06e+99: tmp = x / a elif a <= 6.8e+26: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.06e+99) tmp = Float64(x / a); elseif (a <= 6.8e+26) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.06e+99) tmp = x / a; elseif (a <= 6.8e+26) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.06e+99], N[(x / a), $MachinePrecision], If[LessEqual[a, 6.8e+26], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.06 \cdot 10^{+99}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{+26}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1.05999999999999999e99 or 6.8000000000000005e26 < a Initial program 79.4%
*-commutative79.4%
associate-/l*80.4%
associate-*l/81.3%
Simplified81.3%
Taylor expanded in x around inf 60.7%
Taylor expanded in a around inf 54.8%
if -1.05999999999999999e99 < a < 6.8000000000000005e26Initial program 77.8%
*-commutative77.8%
associate-/l*78.7%
associate-*l/78.3%
Simplified78.3%
Taylor expanded in t around 0 41.7%
Final simplification46.6%
(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 78.4%
*-commutative78.4%
associate-/l*79.3%
associate-*l/79.4%
Simplified79.4%
Taylor expanded in x around inf 52.3%
Taylor expanded in a around inf 25.7%
Final simplification25.7%
(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 2023213
(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))))