
(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 13 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)))))
(if (<= t_1 (- INFINITY))
(* (/ y t) (/ z (+ (+ a 1.0) (* b (/ y t)))))
(if (<= t_1 1e+300) 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 <= -((double) INFINITY)) {
tmp = (y / t) * (z / ((a + 1.0) + (b * (y / t))));
} else if (t_1 <= 1e+300) {
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)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y / t) * (z / ((a + 1.0) + (b * (y / t))));
} else if (t_1 <= 1e+300) {
tmp = t_1;
} 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 <= -math.inf: tmp = (y / t) * (z / ((a + 1.0) + (b * (y / t)))) elif t_1 <= 1e+300: 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 <= Float64(-Inf)) tmp = Float64(Float64(y / t) * Float64(z / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t))))); elseif (t_1 <= 1e+300) 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)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= -Inf) tmp = (y / t) * (z / ((a + 1.0) + (b * (y / t)))); elseif (t_1 <= 1e+300) 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[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y / t), $MachinePrecision] * N[(z / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+300], 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 -\infty:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;t\_1 \leq 10^{+300}:\\
\;\;\;\;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 20.3%
*-commutative20.3%
associate-*l/49.6%
*-commutative49.6%
associate-*l/49.2%
Simplified49.2%
Taylor expanded in x around 0 55.3%
times-frac77.8%
associate-+r+77.8%
associate-/l*76.6%
+-commutative76.6%
associate-/l*77.8%
associate-*r/76.6%
fma-define76.6%
Simplified76.6%
fma-undefine76.6%
Applied egg-rr76.6%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.0000000000000001e300Initial program 90.9%
if 1.0000000000000001e300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 16.2%
*-commutative16.2%
associate-*l/19.2%
*-commutative19.2%
associate-*l/24.8%
Simplified24.8%
Taylor expanded in t around 0 85.9%
Final simplification89.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.8e+26)
(/ x a)
(if (<= a -8.5e-101)
(/ z b)
(if (<= a -4.2e-215)
x
(if (or (<= a 2.15e+27) (and (not (<= a 2.75e+109)) (<= a 4.5e+133)))
(/ z b)
(/ x a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.8e+26) {
tmp = x / a;
} else if (a <= -8.5e-101) {
tmp = z / b;
} else if (a <= -4.2e-215) {
tmp = x;
} else if ((a <= 2.15e+27) || (!(a <= 2.75e+109) && (a <= 4.5e+133))) {
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 <= (-2.8d+26)) then
tmp = x / a
else if (a <= (-8.5d-101)) then
tmp = z / b
else if (a <= (-4.2d-215)) then
tmp = x
else if ((a <= 2.15d+27) .or. (.not. (a <= 2.75d+109)) .and. (a <= 4.5d+133)) 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 <= -2.8e+26) {
tmp = x / a;
} else if (a <= -8.5e-101) {
tmp = z / b;
} else if (a <= -4.2e-215) {
tmp = x;
} else if ((a <= 2.15e+27) || (!(a <= 2.75e+109) && (a <= 4.5e+133))) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.8e+26: tmp = x / a elif a <= -8.5e-101: tmp = z / b elif a <= -4.2e-215: tmp = x elif (a <= 2.15e+27) or (not (a <= 2.75e+109) and (a <= 4.5e+133)): tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.8e+26) tmp = Float64(x / a); elseif (a <= -8.5e-101) tmp = Float64(z / b); elseif (a <= -4.2e-215) tmp = x; elseif ((a <= 2.15e+27) || (!(a <= 2.75e+109) && (a <= 4.5e+133))) 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 <= -2.8e+26) tmp = x / a; elseif (a <= -8.5e-101) tmp = z / b; elseif (a <= -4.2e-215) tmp = x; elseif ((a <= 2.15e+27) || (~((a <= 2.75e+109)) && (a <= 4.5e+133))) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.8e+26], N[(x / a), $MachinePrecision], If[LessEqual[a, -8.5e-101], N[(z / b), $MachinePrecision], If[LessEqual[a, -4.2e-215], x, If[Or[LessEqual[a, 2.15e+27], And[N[Not[LessEqual[a, 2.75e+109]], $MachinePrecision], LessEqual[a, 4.5e+133]]], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{+26}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -8.5 \cdot 10^{-101}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-215}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.15 \cdot 10^{+27} \lor \neg \left(a \leq 2.75 \cdot 10^{+109}\right) \land a \leq 4.5 \cdot 10^{+133}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -2.8e26 or 2.15000000000000004e27 < a < 2.7499999999999999e109 or 4.49999999999999985e133 < a Initial program 81.8%
*-commutative81.8%
associate-*l/78.3%
*-commutative78.3%
associate-*l/77.4%
Simplified77.4%
Taylor expanded in x around inf 61.9%
Taylor expanded in a around inf 60.9%
if -2.8e26 < a < -8.49999999999999941e-101 or -4.2e-215 < a < 2.15000000000000004e27 or 2.7499999999999999e109 < a < 4.49999999999999985e133Initial program 72.6%
*-commutative72.6%
associate-*l/65.7%
*-commutative65.7%
associate-*l/67.0%
Simplified67.0%
Taylor expanded in t around 0 50.8%
if -8.49999999999999941e-101 < a < -4.2e-215Initial program 83.0%
*-commutative83.0%
associate-*l/94.0%
*-commutative94.0%
associate-*l/93.8%
Simplified93.8%
Taylor expanded in a around 0 83.0%
Taylor expanded in y around 0 55.8%
Final simplification55.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.8e+76)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= z -3.2e+44)
(/ z b)
(if (<= z 6.8e+30)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(* (/ y t) (/ z (+ (+ a 1.0) (* b (/ y t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.8e+76) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (z <= -3.2e+44) {
tmp = z / b;
} else if (z <= 6.8e+30) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = (y / t) * (z / ((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 (z <= (-2.8d+76)) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (z <= (-3.2d+44)) then
tmp = z / b
else if (z <= 6.8d+30) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else
tmp = (y / t) * (z / ((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 (z <= -2.8e+76) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (z <= -3.2e+44) {
tmp = z / b;
} else if (z <= 6.8e+30) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = (y / t) * (z / ((a + 1.0) + (b * (y / t))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.8e+76: tmp = (x + ((y * z) / t)) / (a + 1.0) elif z <= -3.2e+44: tmp = z / b elif z <= 6.8e+30: tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = (y / t) * (z / ((a + 1.0) + (b * (y / t)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.8e+76) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (z <= -3.2e+44) tmp = Float64(z / b); elseif (z <= 6.8e+30) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); else tmp = Float64(Float64(y / t) * Float64(z / 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 (z <= -2.8e+76) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (z <= -3.2e+44) tmp = z / b; elseif (z <= 6.8e+30) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = (y / t) * (z / ((a + 1.0) + (b * (y / t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.8e+76], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.2e+44], N[(z / b), $MachinePrecision], If[LessEqual[z, 6.8e+30], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * N[(z / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+76}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+30}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\end{array}
\end{array}
if z < -2.7999999999999999e76Initial program 76.6%
*-commutative76.6%
associate-*l/60.0%
*-commutative60.0%
associate-*l/59.9%
Simplified59.9%
Taylor expanded in b around 0 66.2%
if -2.7999999999999999e76 < z < -3.20000000000000004e44Initial program 41.9%
*-commutative41.9%
associate-*l/32.3%
*-commutative32.3%
associate-*l/32.1%
Simplified32.1%
Taylor expanded in t around 0 81.0%
if -3.20000000000000004e44 < z < 6.8000000000000005e30Initial program 84.0%
*-commutative84.0%
associate-*l/83.9%
*-commutative83.9%
associate-*l/83.1%
Simplified83.1%
Taylor expanded in x around inf 74.1%
if 6.8000000000000005e30 < z Initial program 68.0%
*-commutative68.0%
associate-*l/64.7%
*-commutative64.7%
associate-*l/67.7%
Simplified67.7%
Taylor expanded in x around 0 61.2%
times-frac66.2%
associate-+r+66.2%
associate-/l*62.6%
+-commutative62.6%
associate-/l*66.2%
associate-*r/62.7%
fma-define62.7%
Simplified62.7%
fma-undefine62.7%
Applied egg-rr62.7%
Final simplification70.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t))))
(if (or (<= (+ a 1.0) -5000000.0) (not (<= (+ a 1.0) 1.0)))
(/ t_1 (+ a 1.0))
(/ t_1 (+ 1.0 (* y (/ b t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double tmp;
if (((a + 1.0) <= -5000000.0) || !((a + 1.0) <= 1.0)) {
tmp = t_1 / (a + 1.0);
} else {
tmp = t_1 / (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) :: t_1
real(8) :: tmp
t_1 = x + ((y * z) / t)
if (((a + 1.0d0) <= (-5000000.0d0)) .or. (.not. ((a + 1.0d0) <= 1.0d0))) then
tmp = t_1 / (a + 1.0d0)
else
tmp = t_1 / (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 t_1 = x + ((y * z) / t);
double tmp;
if (((a + 1.0) <= -5000000.0) || !((a + 1.0) <= 1.0)) {
tmp = t_1 / (a + 1.0);
} else {
tmp = t_1 / (1.0 + (y * (b / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) tmp = 0 if ((a + 1.0) <= -5000000.0) or not ((a + 1.0) <= 1.0): tmp = t_1 / (a + 1.0) else: tmp = t_1 / (1.0 + (y * (b / t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) tmp = 0.0 if ((Float64(a + 1.0) <= -5000000.0) || !(Float64(a + 1.0) <= 1.0)) tmp = Float64(t_1 / Float64(a + 1.0)); else tmp = Float64(t_1 / Float64(1.0 + Float64(y * Float64(b / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); tmp = 0.0; if (((a + 1.0) <= -5000000.0) || ~(((a + 1.0) <= 1.0))) tmp = t_1 / (a + 1.0); else tmp = t_1 / (1.0 + (y * (b / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a + 1.0), $MachinePrecision], -5000000.0], N[Not[LessEqual[N[(a + 1.0), $MachinePrecision], 1.0]], $MachinePrecision]], N[(t$95$1 / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
\mathbf{if}\;a + 1 \leq -5000000 \lor \neg \left(a + 1 \leq 1\right):\\
\;\;\;\;\frac{t\_1}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{1 + y \cdot \frac{b}{t}}\\
\end{array}
\end{array}
if (+.f64 a 1) < -5e6 or 1 < (+.f64 a 1) Initial program 78.2%
*-commutative78.2%
associate-*l/73.8%
*-commutative73.8%
associate-*l/75.1%
Simplified75.1%
Taylor expanded in b around 0 68.3%
if -5e6 < (+.f64 a 1) < 1Initial program 76.6%
*-commutative76.6%
associate-*l/72.6%
*-commutative72.6%
associate-*l/71.6%
Simplified71.6%
Taylor expanded in a around 0 76.1%
associate-*l/72.8%
Applied egg-rr72.8%
Final simplification70.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.8e-191) (not (<= t 1.8e-126))) (/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b))))) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.8e-191) || !(t <= 1.8e-126)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.8d-191)) .or. (.not. (t <= 1.8d-126))) then
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (y / (t / b))))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.8e-191) || !(t <= 1.8e-126)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.8e-191) or not (t <= 1.8e-126): tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.8e-191) || !(t <= 1.8e-126)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.8e-191) || ~((t <= 1.8e-126))) tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.8e-191], N[Not[LessEqual[t, 1.8e-126]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-191} \lor \neg \left(t \leq 1.8 \cdot 10^{-126}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -1.8000000000000001e-191 or 1.8e-126 < t Initial program 82.9%
associate-/l*83.8%
associate-+l+83.8%
associate-/l*86.2%
Simplified86.2%
associate-/r/85.4%
Applied egg-rr85.4%
if -1.8000000000000001e-191 < t < 1.8e-126Initial program 61.0%
*-commutative61.0%
associate-*l/44.1%
*-commutative44.1%
associate-*l/37.7%
Simplified37.7%
Taylor expanded in t around 0 62.6%
Final simplification79.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -6.2e-192)
(/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b)))))
(if (<= t 1.6e-133)
(/ z b)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.2e-192) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else if (t <= 1.6e-133) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / ((a + 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 (t <= (-6.2d-192)) then
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (y / (t / b))))
else if (t <= 1.6d-133) then
tmp = z / b
else
tmp = (x + (y * (z / t))) / ((a + 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 (t <= -6.2e-192) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else if (t <= 1.6e-133) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6.2e-192: tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) elif t <= 1.6e-133: tmp = z / b else: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6.2e-192) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); elseif (t <= 1.6e-133) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 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 (t <= -6.2e-192) tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); elseif (t <= 1.6e-133) tmp = z / b; else tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.2e-192], 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], If[LessEqual[t, 1.6e-133], N[(z / b), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{-192}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-133}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\end{array}
\end{array}
if t < -6.2000000000000001e-192Initial program 76.8%
associate-/l*78.4%
associate-+l+78.4%
associate-/l*80.0%
Simplified80.0%
associate-/r/79.4%
Applied egg-rr79.4%
if -6.2000000000000001e-192 < t < 1.60000000000000006e-133Initial program 60.6%
*-commutative60.6%
associate-*l/42.9%
*-commutative42.9%
associate-*l/36.2%
Simplified36.2%
Taylor expanded in t around 0 62.4%
if 1.60000000000000006e-133 < t Initial program 89.4%
*-commutative89.4%
associate-*l/89.5%
*-commutative89.5%
associate-*l/92.7%
Simplified92.7%
Final simplification80.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -3.8e-172)
(/ (+ x (/ y (/ t z))) (+ a (+ 1.0 (* b (/ y t)))))
(if (<= t 4.5e-134)
(/ z b)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.8e-172) {
tmp = (x + (y / (t / z))) / (a + (1.0 + (b * (y / t))));
} else if (t <= 4.5e-134) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / ((a + 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 (t <= (-3.8d-172)) then
tmp = (x + (y / (t / z))) / (a + (1.0d0 + (b * (y / t))))
else if (t <= 4.5d-134) then
tmp = z / b
else
tmp = (x + (y * (z / t))) / ((a + 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 (t <= -3.8e-172) {
tmp = (x + (y / (t / z))) / (a + (1.0 + (b * (y / t))));
} else if (t <= 4.5e-134) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.8e-172: tmp = (x + (y / (t / z))) / (a + (1.0 + (b * (y / t)))) elif t <= 4.5e-134: tmp = z / b else: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.8e-172) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + Float64(1.0 + Float64(b * Float64(y / t))))); elseif (t <= 4.5e-134) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 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 (t <= -3.8e-172) tmp = (x + (y / (t / z))) / (a + (1.0 + (b * (y / t)))); elseif (t <= 4.5e-134) tmp = z / b; else tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.8e-172], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-134], N[(z / b), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-172}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-134}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\end{array}
\end{array}
if t < -3.79999999999999987e-172Initial program 77.4%
associate-/l*80.1%
associate-+l+80.1%
associate-/l*81.8%
Simplified81.8%
associate-/r/82.8%
Applied egg-rr82.8%
if -3.79999999999999987e-172 < t < 4.5000000000000005e-134Initial program 61.2%
*-commutative61.2%
associate-*l/43.6%
*-commutative43.6%
associate-*l/37.5%
Simplified37.5%
Taylor expanded in t around 0 61.5%
if 4.5000000000000005e-134 < t Initial program 89.4%
*-commutative89.4%
associate-*l/89.5%
*-commutative89.5%
associate-*l/92.7%
Simplified92.7%
Final simplification80.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t))))
(if (or (<= a -0.012) (not (<= a 1.95e-24)))
(/ t_1 (+ a 1.0))
(/ t_1 (+ 1.0 (/ (* y b) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double tmp;
if ((a <= -0.012) || !(a <= 1.95e-24)) {
tmp = t_1 / (a + 1.0);
} else {
tmp = t_1 / (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) :: t_1
real(8) :: tmp
t_1 = x + ((y * z) / t)
if ((a <= (-0.012d0)) .or. (.not. (a <= 1.95d-24))) then
tmp = t_1 / (a + 1.0d0)
else
tmp = t_1 / (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 t_1 = x + ((y * z) / t);
double tmp;
if ((a <= -0.012) || !(a <= 1.95e-24)) {
tmp = t_1 / (a + 1.0);
} else {
tmp = t_1 / (1.0 + ((y * b) / t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) tmp = 0 if (a <= -0.012) or not (a <= 1.95e-24): tmp = t_1 / (a + 1.0) else: tmp = t_1 / (1.0 + ((y * b) / t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) tmp = 0.0 if ((a <= -0.012) || !(a <= 1.95e-24)) tmp = Float64(t_1 / Float64(a + 1.0)); else tmp = Float64(t_1 / Float64(1.0 + Float64(Float64(y * b) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); tmp = 0.0; if ((a <= -0.012) || ~((a <= 1.95e-24))) tmp = t_1 / (a + 1.0); else tmp = t_1 / (1.0 + ((y * b) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -0.012], N[Not[LessEqual[a, 1.95e-24]], $MachinePrecision]], N[(t$95$1 / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
\mathbf{if}\;a \leq -0.012 \lor \neg \left(a \leq 1.95 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{t\_1}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{1 + \frac{y \cdot b}{t}}\\
\end{array}
\end{array}
if a < -0.012 or 1.95e-24 < a Initial program 78.5%
*-commutative78.5%
associate-*l/74.2%
*-commutative74.2%
associate-*l/75.5%
Simplified75.5%
Taylor expanded in b around 0 68.8%
if -0.012 < a < 1.95e-24Initial program 76.2%
*-commutative76.2%
associate-*l/72.1%
*-commutative72.1%
associate-*l/71.1%
Simplified71.1%
Taylor expanded in a around 0 75.7%
Final simplification72.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.65e+48) (not (<= y 0.008))) (/ z 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 <= -2.65e+48) || !(y <= 0.008)) {
tmp = z / 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 <= (-2.65d+48)) .or. (.not. (y <= 0.008d0))) then
tmp = z / 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 <= -2.65e+48) || !(y <= 0.008)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.65e+48) or not (y <= 0.008): tmp = z / 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 <= -2.65e+48) || !(y <= 0.008)) tmp = Float64(z / 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 <= -2.65e+48) || ~((y <= 0.008))) tmp = z / 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, -2.65e+48], N[Not[LessEqual[y, 0.008]], $MachinePrecision]], N[(z / b), $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 -2.65 \cdot 10^{+48} \lor \neg \left(y \leq 0.008\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -2.65e48 or 0.0080000000000000002 < y Initial program 54.8%
*-commutative54.8%
associate-*l/58.7%
*-commutative58.7%
associate-*l/66.3%
Simplified66.3%
Taylor expanded in t around 0 58.9%
if -2.65e48 < y < 0.0080000000000000002Initial program 92.0%
*-commutative92.0%
associate-*l/82.5%
*-commutative82.5%
associate-*l/78.1%
Simplified78.1%
Taylor expanded in x around inf 69.3%
Final simplification65.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.3e+98) (not (<= y 0.0205))) (/ z 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 <= -2.3e+98) || !(y <= 0.0205)) {
tmp = z / 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 <= (-2.3d+98)) .or. (.not. (y <= 0.0205d0))) then
tmp = z / 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 <= -2.3e+98) || !(y <= 0.0205)) {
tmp = z / b;
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.3e+98) or not (y <= 0.0205): tmp = z / 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 <= -2.3e+98) || !(y <= 0.0205)) tmp = Float64(z / 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 <= -2.3e+98) || ~((y <= 0.0205))) tmp = z / 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, -2.3e+98], N[Not[LessEqual[y, 0.0205]], $MachinePrecision]], N[(z / 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 -2.3 \cdot 10^{+98} \lor \neg \left(y \leq 0.0205\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -2.30000000000000013e98 or 0.0205000000000000009 < y Initial program 53.9%
*-commutative53.9%
associate-*l/58.3%
*-commutative58.3%
associate-*l/65.7%
Simplified65.7%
Taylor expanded in t around 0 61.9%
if -2.30000000000000013e98 < y < 0.0205000000000000009Initial program 90.2%
*-commutative90.2%
associate-*l/81.3%
*-commutative81.3%
associate-*l/77.7%
Simplified77.7%
Taylor expanded in b around 0 74.4%
Final simplification70.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.2e+32) (not (<= y 0.0069))) (/ 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.2e+32) || !(y <= 0.0069)) {
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.2d+32)) .or. (.not. (y <= 0.0069d0))) 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.2e+32) || !(y <= 0.0069)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.2e+32) or not (y <= 0.0069): 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.2e+32) || !(y <= 0.0069)) 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.2e+32) || ~((y <= 0.0069))) 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.2e+32], N[Not[LessEqual[y, 0.0069]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+32} \lor \neg \left(y \leq 0.0069\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -2.20000000000000001e32 or 0.0068999999999999999 < y Initial program 55.2%
*-commutative55.2%
associate-*l/59.0%
*-commutative59.0%
associate-*l/66.4%
Simplified66.4%
Taylor expanded in t around 0 58.3%
if -2.20000000000000001e32 < y < 0.0068999999999999999Initial program 92.4%
*-commutative92.4%
associate-*l/82.8%
*-commutative82.8%
associate-*l/78.3%
Simplified78.3%
Taylor expanded in t around inf 62.8%
Final simplification61.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -0.0068) (not (<= a 230000.0))) (/ x a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -0.0068) || !(a <= 230000.0)) {
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 <= (-0.0068d0)) .or. (.not. (a <= 230000.0d0))) 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 <= -0.0068) || !(a <= 230000.0)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -0.0068) or not (a <= 230000.0): tmp = x / a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -0.0068) || !(a <= 230000.0)) 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 <= -0.0068) || ~((a <= 230000.0))) tmp = x / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -0.0068], N[Not[LessEqual[a, 230000.0]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.0068 \lor \neg \left(a \leq 230000\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -0.00679999999999999962 or 2.3e5 < a Initial program 78.5%
*-commutative78.5%
associate-*l/74.0%
*-commutative74.0%
associate-*l/74.6%
Simplified74.6%
Taylor expanded in x around inf 56.4%
Taylor expanded in a around inf 53.6%
if -0.00679999999999999962 < a < 2.3e5Initial program 76.3%
*-commutative76.3%
associate-*l/72.4%
*-commutative72.4%
associate-*l/72.3%
Simplified72.3%
Taylor expanded in a around 0 74.3%
Taylor expanded in y around 0 32.0%
Final simplification43.2%
(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 77.4%
*-commutative77.4%
associate-*l/73.2%
*-commutative73.2%
associate-*l/73.5%
Simplified73.5%
Taylor expanded in a around 0 44.3%
Taylor expanded in y around 0 17.4%
Final simplification17.4%
(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 2024039
(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))))