
(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 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 (- INFINITY))
(* (/ y t) (/ z (+ 1.0 (+ a (* b (/ y t))))))
(if (<= t_1 -1e-320)
t_1
(if (<= t_1 0.0)
(/ (+ z (/ (* x t) y)) b)
(if (<= t_1 5e+279) 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)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y / t) * (z / (1.0 + (a + (b * (y / t)))));
} else if (t_1 <= -1e-320) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z + ((x * t) / y)) / b;
} else if (t_1 <= 5e+279) {
tmp = t_1;
} 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)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y / t) * (z / (1.0 + (a + (b * (y / t)))));
} else if (t_1 <= -1e-320) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z + ((x * t) / y)) / b;
} else if (t_1 <= 5e+279) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= -math.inf: tmp = (y / t) * (z / (1.0 + (a + (b * (y / t))))) elif t_1 <= -1e-320: tmp = t_1 elif t_1 <= 0.0: tmp = (z + ((x * t) / y)) / b elif t_1 <= 5e+279: 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(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y / t) * Float64(z / Float64(1.0 + Float64(a + Float64(b * Float64(y / t)))))); elseif (t_1 <= -1e-320) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (t_1 <= 5e+279) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = (y / t) * (z / (1.0 + (a + (b * (y / t))))); elseif (t_1 <= -1e-320) tmp = t_1; elseif (t_1 <= 0.0) tmp = (z + ((x * t) / y)) / b; elseif (t_1 <= 5e+279) tmp = t_1; 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[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-320], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 5e+279], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-320}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;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))) < -inf.0Initial program 15.9%
*-commutative15.9%
associate-*l/56.2%
associate-+l+56.2%
associate-*r/56.2%
*-commutative56.2%
Simplified56.2%
Taylor expanded in x around 0 44.8%
times-frac74.7%
associate-*r/68.3%
Simplified68.3%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -9.99989e-321 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 5.0000000000000002e279Initial program 99.1%
if -9.99989e-321 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0Initial program 46.8%
*-commutative46.8%
associate-*l/46.8%
associate-+l+46.8%
associate-*r/65.1%
*-commutative65.1%
Simplified65.1%
Taylor expanded in b around inf 46.8%
Taylor expanded in t around 0 61.0%
Taylor expanded in b around 0 70.5%
if 5.0000000000000002e279 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 8.1%
*-commutative8.1%
associate-*l/16.1%
associate-+l+16.1%
associate-*r/23.4%
*-commutative23.4%
Simplified23.4%
Taylor expanded in t around 0 85.2%
Final simplification89.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.15e-274) (not (<= t 2.1e-103))) (/ (+ x (* y (/ z t))) (+ a (+ 1.0 (* y (/ b t))))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.15e-274) || !(t <= 2.1e-103)) {
tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t))));
} else {
tmp = (z + ((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 <= (-3.15d-274)) .or. (.not. (t <= 2.1d-103))) then
tmp = (x + (y * (z / t))) / (a + (1.0d0 + (y * (b / t))))
else
tmp = (z + ((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 <= -3.15e-274) || !(t <= 2.1e-103)) {
tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t))));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.15e-274) or not (t <= 2.1e-103): tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.15e-274) || !(t <= 2.1e-103)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + Float64(1.0 + Float64(y * Float64(b / t))))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.15e-274) || ~((t <= 2.1e-103))) tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.15e-274], N[Not[LessEqual[t, 2.1e-103]], $MachinePrecision]], 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], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.15 \cdot 10^{-274} \lor \neg \left(t \leq 2.1 \cdot 10^{-103}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -3.14999999999999978e-274 or 2.10000000000000005e-103 < t Initial program 78.4%
*-commutative78.4%
associate-*l/81.6%
associate-+l+81.6%
associate-*r/85.3%
*-commutative85.3%
Simplified85.3%
if -3.14999999999999978e-274 < t < 2.10000000000000005e-103Initial program 40.9%
*-commutative40.9%
associate-*l/32.9%
associate-+l+32.9%
associate-*r/28.0%
*-commutative28.0%
Simplified28.0%
Taylor expanded in b around inf 38.7%
Taylor expanded in t around 0 79.0%
Taylor expanded in b around 0 80.8%
Final simplification84.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.6e-171) (not (<= t 1.05e-103))) (/ (+ x (/ y (/ t z))) (+ a (+ 1.0 (/ b (/ t y))))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.6e-171) || !(t <= 1.05e-103)) {
tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y))));
} else {
tmp = (z + ((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 <= (-3.6d-171)) .or. (.not. (t <= 1.05d-103))) then
tmp = (x + (y / (t / z))) / (a + (1.0d0 + (b / (t / y))))
else
tmp = (z + ((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 <= -3.6e-171) || !(t <= 1.05e-103)) {
tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y))));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.6e-171) or not (t <= 1.05e-103): tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y)))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.6e-171) || !(t <= 1.05e-103)) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.6e-171) || ~((t <= 1.05e-103))) tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y)))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.6e-171], N[Not[LessEqual[t, 1.05e-103]], $MachinePrecision]], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-171} \lor \neg \left(t \leq 1.05 \cdot 10^{-103}\right):\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -3.60000000000000003e-171 or 1.05000000000000002e-103 < t Initial program 79.2%
associate-/l*82.0%
associate-*l/88.1%
*-commutative88.1%
cancel-sign-sub88.1%
*-commutative88.1%
associate-*l/82.0%
associate-+r-82.0%
associate-*l/88.1%
*-commutative88.1%
cancel-sign-sub88.1%
*-commutative88.1%
associate-*l/82.0%
*-commutative82.0%
associate-/l*88.2%
Simplified88.2%
if -3.60000000000000003e-171 < t < 1.05000000000000002e-103Initial program 45.3%
*-commutative45.3%
associate-*l/40.0%
associate-+l+40.0%
associate-*r/35.9%
*-commutative35.9%
Simplified35.9%
Taylor expanded in b around inf 42.2%
Taylor expanded in t around 0 77.2%
Taylor expanded in b around 0 78.7%
Final simplification85.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 (+ a (* b (/ y t)))))))
(if (<= t -1e-35)
t_1
(if (<= t -7e-80)
(* (/ y t) (/ z (+ a 1.0)))
(if (or (<= t -1e-169) (not (<= t 1.5e-103)))
t_1
(/ (+ z (/ (* x t) y)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (a + (b * (y / t))));
double tmp;
if (t <= -1e-35) {
tmp = t_1;
} else if (t <= -7e-80) {
tmp = (y / t) * (z / (a + 1.0));
} else if ((t <= -1e-169) || !(t <= 1.5e-103)) {
tmp = t_1;
} else {
tmp = (z + ((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) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 + (a + (b * (y / t))))
if (t <= (-1d-35)) then
tmp = t_1
else if (t <= (-7d-80)) then
tmp = (y / t) * (z / (a + 1.0d0))
else if ((t <= (-1d-169)) .or. (.not. (t <= 1.5d-103))) then
tmp = t_1
else
tmp = (z + ((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 t_1 = x / (1.0 + (a + (b * (y / t))));
double tmp;
if (t <= -1e-35) {
tmp = t_1;
} else if (t <= -7e-80) {
tmp = (y / t) * (z / (a + 1.0));
} else if ((t <= -1e-169) || !(t <= 1.5e-103)) {
tmp = t_1;
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 + (a + (b * (y / t)))) tmp = 0 if t <= -1e-35: tmp = t_1 elif t <= -7e-80: tmp = (y / t) * (z / (a + 1.0)) elif (t <= -1e-169) or not (t <= 1.5e-103): tmp = t_1 else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t))))) tmp = 0.0 if (t <= -1e-35) tmp = t_1; elseif (t <= -7e-80) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); elseif ((t <= -1e-169) || !(t <= 1.5e-103)) tmp = t_1; else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 + (a + (b * (y / t)))); tmp = 0.0; if (t <= -1e-35) tmp = t_1; elseif (t <= -7e-80) tmp = (y / t) * (z / (a + 1.0)); elseif ((t <= -1e-169) || ~((t <= 1.5e-103))) tmp = t_1; else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e-35], t$95$1, If[LessEqual[t, -7e-80], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1e-169], N[Not[LessEqual[t, 1.5e-103]], $MachinePrecision]], t$95$1, N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\mathbf{if}\;t \leq -1 \cdot 10^{-35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7 \cdot 10^{-80}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-169} \lor \neg \left(t \leq 1.5 \cdot 10^{-103}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -1.00000000000000001e-35 or -7.00000000000000029e-80 < t < -1.00000000000000002e-169 or 1.5e-103 < t Initial program 79.9%
*-commutative79.9%
associate-*l/82.9%
associate-+l+82.9%
associate-*r/87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x around inf 63.0%
associate-*r/65.6%
Simplified65.6%
if -1.00000000000000001e-35 < t < -7.00000000000000029e-80Initial program 62.8%
*-commutative62.8%
associate-*l/63.3%
associate-+l+63.3%
associate-*r/63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in b around 0 58.8%
Taylor expanded in x around 0 71.3%
times-frac71.1%
Simplified71.1%
if -1.00000000000000002e-169 < t < 1.5e-103Initial program 45.3%
*-commutative45.3%
associate-*l/40.0%
associate-+l+40.0%
associate-*r/35.9%
*-commutative35.9%
Simplified35.9%
Taylor expanded in b around inf 42.2%
Taylor expanded in t around 0 77.2%
Taylor expanded in b around 0 78.7%
Final simplification69.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.1e+61) (not (<= y 1.42e+38))) (/ (+ z (/ (* x t) y)) b) (/ (+ x (* (* y z) (/ 1.0 t))) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.1e+61) || !(y <= 1.42e+38)) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.1d+61)) .or. (.not. (y <= 1.42d+38))) then
tmp = (z + ((x * t) / y)) / b
else
tmp = (x + ((y * z) * (1.0d0 / t))) / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.1e+61) || !(y <= 1.42e+38)) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.1e+61) or not (y <= 1.42e+38): tmp = (z + ((x * t) / y)) / b else: tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.1e+61) || !(y <= 1.42e+38)) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); else tmp = Float64(Float64(x + Float64(Float64(y * z) * Float64(1.0 / t))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.1e+61) || ~((y <= 1.42e+38))) tmp = (z + ((x * t) / y)) / b; else tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.1e+61], N[Not[LessEqual[y, 1.42e+38]], $MachinePrecision]], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+61} \lor \neg \left(y \leq 1.42 \cdot 10^{+38}\right):\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(y \cdot z\right) \cdot \frac{1}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -1.1e61 or 1.4200000000000001e38 < y Initial program 44.4%
*-commutative44.4%
associate-*l/50.5%
associate-+l+50.5%
associate-*r/59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in b around inf 26.3%
Taylor expanded in t around 0 57.9%
Taylor expanded in b around 0 61.7%
if -1.1e61 < y < 1.4200000000000001e38Initial program 90.6%
*-commutative90.6%
associate-*l/86.5%
associate-+l+86.5%
associate-*r/82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in b around 0 78.8%
div-inv78.9%
Applied egg-rr78.9%
Final simplification71.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.3e+61) (not (<= y 2.3e+38))) (/ (+ z (/ (* x t) y)) b) (/ (+ x (* y (/ z t))) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.3e+61) || !(y <= 2.3e+38)) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.3d+61)) .or. (.not. (y <= 2.3d+38))) then
tmp = (z + ((x * t) / y)) / b
else
tmp = (x + (y * (z / t))) / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.3e+61) || !(y <= 2.3e+38)) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.3e+61) or not (y <= 2.3e+38): tmp = (z + ((x * t) / y)) / b else: tmp = (x + (y * (z / t))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.3e+61) || !(y <= 2.3e+38)) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.3e+61) || ~((y <= 2.3e+38))) tmp = (z + ((x * t) / y)) / b; else tmp = (x + (y * (z / t))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.3e+61], N[Not[LessEqual[y, 2.3e+38]], $MachinePrecision]], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+61} \lor \neg \left(y \leq 2.3 \cdot 10^{+38}\right):\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -1.29999999999999986e61 or 2.3000000000000001e38 < y Initial program 44.4%
*-commutative44.4%
associate-*l/50.5%
associate-+l+50.5%
associate-*r/59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in b around inf 26.3%
Taylor expanded in t around 0 57.9%
Taylor expanded in b around 0 61.7%
if -1.29999999999999986e61 < y < 2.3000000000000001e38Initial program 90.6%
*-commutative90.6%
associate-*l/86.5%
associate-+l+86.5%
associate-*r/82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in b around 0 76.1%
Final simplification69.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5e+61) (not (<= y 1.02e+38))) (/ (+ z (/ (* x t) y)) b) (/ (+ x (/ (* y z) t)) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5e+61) || !(y <= 1.02e+38)) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + ((y * z) / t)) / (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 <= (-5d+61)) .or. (.not. (y <= 1.02d+38))) then
tmp = (z + ((x * t) / y)) / b
else
tmp = (x + ((y * z) / t)) / (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 <= -5e+61) || !(y <= 1.02e+38)) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5e+61) or not (y <= 1.02e+38): tmp = (z + ((x * t) / y)) / b else: tmp = (x + ((y * z) / t)) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5e+61) || !(y <= 1.02e+38)) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); else tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5e+61) || ~((y <= 1.02e+38))) tmp = (z + ((x * t) / y)) / b; else tmp = (x + ((y * z) / t)) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5e+61], N[Not[LessEqual[y, 1.02e+38]], $MachinePrecision]], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+61} \lor \neg \left(y \leq 1.02 \cdot 10^{+38}\right):\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -5.00000000000000018e61 or 1.02000000000000006e38 < y Initial program 44.4%
*-commutative44.4%
associate-*l/50.5%
associate-+l+50.5%
associate-*r/59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in b around inf 26.3%
Taylor expanded in t around 0 57.9%
Taylor expanded in b around 0 61.7%
if -5.00000000000000018e61 < y < 1.02000000000000006e38Initial program 90.6%
*-commutative90.6%
associate-*l/86.5%
associate-+l+86.5%
associate-*r/82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in b around 0 78.8%
Final simplification71.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.5e+60) (not (<= y 3.7e-25))) (/ (+ z (/ (* x t) y)) b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.5e+60) || !(y <= 3.7e-25)) {
tmp = (z + ((x * t) / 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 <= (-7.5d+60)) .or. (.not. (y <= 3.7d-25))) then
tmp = (z + ((x * t) / 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 <= -7.5e+60) || !(y <= 3.7e-25)) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.5e+60) or not (y <= 3.7e-25): tmp = (z + ((x * t) / y)) / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.5e+60) || !(y <= 3.7e-25)) tmp = Float64(Float64(z + Float64(Float64(x * t) / 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 <= -7.5e+60) || ~((y <= 3.7e-25))) tmp = (z + ((x * t) / y)) / b; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.5e+60], N[Not[LessEqual[y, 3.7e-25]], $MachinePrecision]], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+60} \lor \neg \left(y \leq 3.7 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -7.5e60 or 3.70000000000000009e-25 < y Initial program 47.2%
*-commutative47.2%
associate-*l/52.6%
associate-+l+52.6%
associate-*r/60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in b around inf 27.3%
Taylor expanded in t around 0 56.1%
Taylor expanded in b around 0 59.4%
if -7.5e60 < y < 3.70000000000000009e-25Initial program 93.2%
*-commutative93.2%
associate-*l/88.6%
associate-+l+88.6%
associate-*r/83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in t around inf 61.9%
Final simplification60.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.05e+61) (not (<= y 2.8e+36))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.05e+61) || !(y <= 2.8e+36)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.05d+61)) .or. (.not. (y <= 2.8d+36))) then
tmp = z / b
else
tmp = x / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.05e+61) || !(y <= 2.8e+36)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.05e+61) or not (y <= 2.8e+36): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.05e+61) || !(y <= 2.8e+36)) tmp = Float64(z / b); else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.05e+61) || ~((y <= 2.8e+36))) tmp = z / b; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.05e+61], N[Not[LessEqual[y, 2.8e+36]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+61} \lor \neg \left(y \leq 2.8 \cdot 10^{+36}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -1.0500000000000001e61 or 2.8000000000000001e36 < y Initial program 44.4%
*-commutative44.4%
associate-*l/50.5%
associate-+l+50.5%
associate-*r/59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in t around 0 53.0%
if -1.0500000000000001e61 < y < 2.8000000000000001e36Initial program 90.6%
*-commutative90.6%
associate-*l/86.5%
associate-+l+86.5%
associate-*r/82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in t around inf 59.1%
Final simplification56.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -435000000.0) (not (<= a 1.32e+14))) (/ x a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -435000000.0) || !(a <= 1.32e+14)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-435000000.0d0)) .or. (.not. (a <= 1.32d+14))) then
tmp = x / a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -435000000.0) || !(a <= 1.32e+14)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -435000000.0) or not (a <= 1.32e+14): tmp = x / a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -435000000.0) || !(a <= 1.32e+14)) tmp = Float64(x / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -435000000.0) || ~((a <= 1.32e+14))) tmp = x / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -435000000.0], N[Not[LessEqual[a, 1.32e+14]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -435000000 \lor \neg \left(a \leq 1.32 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.35e8 or 1.32e14 < a Initial program 67.3%
*-commutative67.3%
associate-*l/68.2%
associate-+l+68.2%
associate-*r/70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in x around inf 55.2%
associate-*r/58.0%
Simplified58.0%
Taylor expanded in a around inf 48.0%
if -4.35e8 < a < 1.32e14Initial program 72.4%
*-commutative72.4%
associate-*l/72.6%
associate-+l+72.6%
associate-*r/73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in t around inf 29.6%
Taylor expanded in a around 0 28.4%
Final simplification38.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -7.2e+116) (not (<= a 6.5e+49))) (/ x a) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7.2e+116) || !(a <= 6.5e+49)) {
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 <= (-7.2d+116)) .or. (.not. (a <= 6.5d+49))) 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 <= -7.2e+116) || !(a <= 6.5e+49)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -7.2e+116) or not (a <= 6.5e+49): tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -7.2e+116) || !(a <= 6.5e+49)) 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 <= -7.2e+116) || ~((a <= 6.5e+49))) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -7.2e+116], N[Not[LessEqual[a, 6.5e+49]], $MachinePrecision]], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{+116} \lor \neg \left(a \leq 6.5 \cdot 10^{+49}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if a < -7.19999999999999941e116 or 6.5000000000000005e49 < a Initial program 72.4%
*-commutative72.4%
associate-*l/73.6%
associate-+l+73.6%
associate-*r/76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in x around inf 61.4%
associate-*r/64.2%
Simplified64.2%
Taylor expanded in a around inf 55.6%
if -7.19999999999999941e116 < a < 6.5000000000000005e49Initial program 67.9%
*-commutative67.9%
associate-*l/68.0%
associate-+l+68.0%
associate-*r/69.0%
*-commutative69.0%
Simplified69.0%
Taylor expanded in t around 0 41.7%
Final simplification47.1%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 69.6%
*-commutative69.6%
associate-*l/70.2%
associate-+l+70.2%
associate-*r/71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in t around inf 39.5%
Taylor expanded in a around 0 15.1%
Final simplification15.1%
(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 2023309
(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))))