
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
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)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\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)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
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)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5e+67) (not (<= z 2000000000.0))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (fma y z x) (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5e+67) || !(z <= 2000000000.0)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = fma(y, z, x) + (a * (t + (z * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5e+67) || !(z <= 2000000000.0)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5e+67], N[Not[LessEqual[z, 2000000000.0]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+67} \lor \neg \left(z \leq 2000000000\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -4.99999999999999976e67 or 2e9 < z Initial program 86.6%
associate-+l+86.6%
associate-*l*84.3%
Simplified84.3%
Taylor expanded in z around inf 99.1%
+-commutative99.1%
associate-+l+99.1%
+-commutative99.1%
associate-/l*99.9%
distribute-lft-out99.9%
Simplified99.9%
if -4.99999999999999976e67 < z < 2e9Initial program 96.2%
associate-+l+96.2%
+-commutative96.2%
fma-define96.2%
associate-*l*98.4%
*-commutative98.4%
*-commutative98.4%
distribute-rgt-out100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.05e+109)
(* z (+ y (* a b)))
(if (or (<= b 2.4e+35) (and (not (<= b 2e+73)) (<= b 3.2e+142)))
(+ x (+ (* z y) (* a t)))
(+ x (* z (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.05e+109) {
tmp = z * (y + (a * b));
} else if ((b <= 2.4e+35) || (!(b <= 2e+73) && (b <= 3.2e+142))) {
tmp = x + ((z * y) + (a * t));
} else {
tmp = x + (z * (a * 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 (b <= (-1.05d+109)) then
tmp = z * (y + (a * b))
else if ((b <= 2.4d+35) .or. (.not. (b <= 2d+73)) .and. (b <= 3.2d+142)) then
tmp = x + ((z * y) + (a * t))
else
tmp = x + (z * (a * 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 (b <= -1.05e+109) {
tmp = z * (y + (a * b));
} else if ((b <= 2.4e+35) || (!(b <= 2e+73) && (b <= 3.2e+142))) {
tmp = x + ((z * y) + (a * t));
} else {
tmp = x + (z * (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.05e+109: tmp = z * (y + (a * b)) elif (b <= 2.4e+35) or (not (b <= 2e+73) and (b <= 3.2e+142)): tmp = x + ((z * y) + (a * t)) else: tmp = x + (z * (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.05e+109) tmp = Float64(z * Float64(y + Float64(a * b))); elseif ((b <= 2.4e+35) || (!(b <= 2e+73) && (b <= 3.2e+142))) tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); else tmp = Float64(x + Float64(z * Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.05e+109) tmp = z * (y + (a * b)); elseif ((b <= 2.4e+35) || (~((b <= 2e+73)) && (b <= 3.2e+142))) tmp = x + ((z * y) + (a * t)); else tmp = x + (z * (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.05e+109], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, 2.4e+35], And[N[Not[LessEqual[b, 2e+73]], $MachinePrecision], LessEqual[b, 3.2e+142]]], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.05 \cdot 10^{+109}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{+35} \lor \neg \left(b \leq 2 \cdot 10^{+73}\right) \land b \leq 3.2 \cdot 10^{+142}:\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -1.0500000000000001e109Initial program 84.7%
associate-+l+84.7%
associate-*l*76.0%
Simplified76.0%
Taylor expanded in z around inf 81.4%
if -1.0500000000000001e109 < b < 2.40000000000000015e35 or 1.99999999999999997e73 < b < 3.20000000000000005e142Initial program 94.1%
associate-+l+94.1%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in b around 0 90.4%
if 2.40000000000000015e35 < b < 1.99999999999999997e73 or 3.20000000000000005e142 < b Initial program 88.6%
associate-+l+88.6%
associate-*l*86.4%
Simplified86.4%
Taylor expanded in t around 0 82.1%
+-commutative82.1%
+-commutative82.1%
associate-*r*82.6%
distribute-rgt-in87.1%
Simplified87.1%
Taylor expanded in y around 0 80.4%
*-commutative80.4%
Simplified80.4%
Final simplification87.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.1e+121)
(* z y)
(if (<= y -1.5e+89)
x
(if (<= y -1.6e+75)
(* z y)
(if (<= y -2.5e-115) (* a t) (if (<= y 8.8e+18) x (* z y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.1e+121) {
tmp = z * y;
} else if (y <= -1.5e+89) {
tmp = x;
} else if (y <= -1.6e+75) {
tmp = z * y;
} else if (y <= -2.5e-115) {
tmp = a * t;
} else if (y <= 8.8e+18) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-3.1d+121)) then
tmp = z * y
else if (y <= (-1.5d+89)) then
tmp = x
else if (y <= (-1.6d+75)) then
tmp = z * y
else if (y <= (-2.5d-115)) then
tmp = a * t
else if (y <= 8.8d+18) then
tmp = x
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.1e+121) {
tmp = z * y;
} else if (y <= -1.5e+89) {
tmp = x;
} else if (y <= -1.6e+75) {
tmp = z * y;
} else if (y <= -2.5e-115) {
tmp = a * t;
} else if (y <= 8.8e+18) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.1e+121: tmp = z * y elif y <= -1.5e+89: tmp = x elif y <= -1.6e+75: tmp = z * y elif y <= -2.5e-115: tmp = a * t elif y <= 8.8e+18: tmp = x else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.1e+121) tmp = Float64(z * y); elseif (y <= -1.5e+89) tmp = x; elseif (y <= -1.6e+75) tmp = Float64(z * y); elseif (y <= -2.5e-115) tmp = Float64(a * t); elseif (y <= 8.8e+18) tmp = x; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.1e+121) tmp = z * y; elseif (y <= -1.5e+89) tmp = x; elseif (y <= -1.6e+75) tmp = z * y; elseif (y <= -2.5e-115) tmp = a * t; elseif (y <= 8.8e+18) tmp = x; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.1e+121], N[(z * y), $MachinePrecision], If[LessEqual[y, -1.5e+89], x, If[LessEqual[y, -1.6e+75], N[(z * y), $MachinePrecision], If[LessEqual[y, -2.5e-115], N[(a * t), $MachinePrecision], If[LessEqual[y, 8.8e+18], x, N[(z * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+121}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{+89}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{+75}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-115}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{+18}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if y < -3.10000000000000008e121 or -1.50000000000000006e89 < y < -1.59999999999999992e75 or 8.8e18 < y Initial program 89.9%
associate-+l+89.9%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in y around inf 54.1%
*-commutative54.1%
Simplified54.1%
if -3.10000000000000008e121 < y < -1.50000000000000006e89 or -2.5000000000000001e-115 < y < 8.8e18Initial program 92.1%
associate-+l+92.1%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 43.2%
if -1.59999999999999992e75 < y < -2.5000000000000001e-115Initial program 94.5%
associate-+l+94.5%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in t around inf 39.1%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -1.85e-23)
(and (not (<= z 1.45e-167)) (or (<= z 7.4e-128) (not (<= z 3e+24)))))
(* z (+ y (* a b)))
(+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.85e-23) || (!(z <= 1.45e-167) && ((z <= 7.4e-128) || !(z <= 3e+24)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * 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 <= (-1.85d-23)) .or. (.not. (z <= 1.45d-167)) .and. (z <= 7.4d-128) .or. (.not. (z <= 3d+24))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * 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 <= -1.85e-23) || (!(z <= 1.45e-167) && ((z <= 7.4e-128) || !(z <= 3e+24)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.85e-23) or (not (z <= 1.45e-167) and ((z <= 7.4e-128) or not (z <= 3e+24))): tmp = z * (y + (a * b)) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.85e-23) || (!(z <= 1.45e-167) && ((z <= 7.4e-128) || !(z <= 3e+24)))) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.85e-23) || (~((z <= 1.45e-167)) && ((z <= 7.4e-128) || ~((z <= 3e+24))))) tmp = z * (y + (a * b)); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.85e-23], And[N[Not[LessEqual[z, 1.45e-167]], $MachinePrecision], Or[LessEqual[z, 7.4e-128], N[Not[LessEqual[z, 3e+24]], $MachinePrecision]]]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-23} \lor \neg \left(z \leq 1.45 \cdot 10^{-167}\right) \land \left(z \leq 7.4 \cdot 10^{-128} \lor \neg \left(z \leq 3 \cdot 10^{+24}\right)\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -1.8500000000000001e-23 or 1.45000000000000001e-167 < z < 7.4e-128 or 2.99999999999999995e24 < z Initial program 86.9%
associate-+l+86.9%
associate-*l*85.6%
Simplified85.6%
Taylor expanded in z around inf 80.0%
if -1.8500000000000001e-23 < z < 1.45000000000000001e-167 or 7.4e-128 < z < 2.99999999999999995e24Initial program 97.4%
associate-+l+97.4%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in z around 0 79.2%
+-commutative79.2%
Simplified79.2%
Final simplification79.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.4e+21) (not (<= z 100000.0))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (+ x (* z y)) (+ (* a t) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.4e+21) || !(z <= 100000.0)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (z * y)) + ((a * t) + (a * (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 ((z <= (-4.4d+21)) .or. (.not. (z <= 100000.0d0))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = (x + (z * y)) + ((a * t) + (a * (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 ((z <= -4.4e+21) || !(z <= 100000.0)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.4e+21) or not (z <= 100000.0): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = (x + (z * y)) + ((a * t) + (a * (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.4e+21) || !(z <= 100000.0)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * t) + Float64(a * Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.4e+21) || ~((z <= 100000.0))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = (x + (z * y)) + ((a * t) + (a * (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.4e+21], N[Not[LessEqual[z, 100000.0]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+21} \lor \neg \left(z \leq 100000\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -4.4e21 or 1e5 < z Initial program 85.6%
associate-+l+85.6%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in z around inf 98.4%
+-commutative98.4%
associate-+l+98.4%
+-commutative98.4%
associate-/l*99.2%
distribute-lft-out99.9%
Simplified99.9%
if -4.4e21 < z < 1e5Initial program 97.6%
associate-+l+97.6%
associate-*l*99.2%
Simplified99.2%
Final simplification99.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.2e-21) (not (<= z 2.9e-9))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (+ (* z y) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.2e-21) || !(z <= 2.9e-9)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((z * y) + (a * 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 <= (-3.2d-21)) .or. (.not. (z <= 2.9d-9))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = x + ((z * y) + (a * 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 <= -3.2e-21) || !(z <= 2.9e-9)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((z * y) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.2e-21) or not (z <= 2.9e-9): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + ((z * y) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.2e-21) || !(z <= 2.9e-9)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -3.2e-21) || ~((z <= 2.9e-9))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + ((z * y) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.2e-21], N[Not[LessEqual[z, 2.9e-9]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-21} \lor \neg \left(z \leq 2.9 \cdot 10^{-9}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\end{array}
\end{array}
if z < -3.2000000000000002e-21 or 2.89999999999999991e-9 < z Initial program 86.3%
associate-+l+86.3%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in z around inf 98.5%
+-commutative98.5%
associate-+l+98.5%
+-commutative98.5%
associate-/l*99.2%
distribute-lft-out99.9%
Simplified99.9%
if -3.2000000000000002e-21 < z < 2.89999999999999991e-9Initial program 97.5%
associate-+l+97.5%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in b around 0 89.2%
Final simplification95.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3.2e-31)
(* a (* z b))
(if (<= z -3.6e-220)
x
(if (<= z -6.2e-264) (* a t) (if (<= z 2.35e+26) x (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.2e-31) {
tmp = a * (z * b);
} else if (z <= -3.6e-220) {
tmp = x;
} else if (z <= -6.2e-264) {
tmp = a * t;
} else if (z <= 2.35e+26) {
tmp = x;
} else {
tmp = z * y;
}
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 <= (-3.2d-31)) then
tmp = a * (z * b)
else if (z <= (-3.6d-220)) then
tmp = x
else if (z <= (-6.2d-264)) then
tmp = a * t
else if (z <= 2.35d+26) then
tmp = x
else
tmp = z * y
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 <= -3.2e-31) {
tmp = a * (z * b);
} else if (z <= -3.6e-220) {
tmp = x;
} else if (z <= -6.2e-264) {
tmp = a * t;
} else if (z <= 2.35e+26) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.2e-31: tmp = a * (z * b) elif z <= -3.6e-220: tmp = x elif z <= -6.2e-264: tmp = a * t elif z <= 2.35e+26: tmp = x else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.2e-31) tmp = Float64(a * Float64(z * b)); elseif (z <= -3.6e-220) tmp = x; elseif (z <= -6.2e-264) tmp = Float64(a * t); elseif (z <= 2.35e+26) tmp = x; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.2e-31) tmp = a * (z * b); elseif (z <= -3.6e-220) tmp = x; elseif (z <= -6.2e-264) tmp = a * t; elseif (z <= 2.35e+26) tmp = x; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.2e-31], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-220], x, If[LessEqual[z, -6.2e-264], N[(a * t), $MachinePrecision], If[LessEqual[z, 2.35e+26], x, N[(z * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-31}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-220}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-264}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -3.20000000000000018e-31Initial program 87.0%
associate-+l+87.0%
associate-*l*90.8%
Simplified90.8%
*-commutative90.8%
distribute-lft-in92.2%
*-commutative92.2%
add-cube-cbrt91.8%
associate-*l*91.8%
pow291.8%
+-commutative91.8%
fma-define91.8%
+-commutative91.8%
fma-define91.8%
Applied egg-rr91.8%
Taylor expanded in b around inf 53.8%
if -3.20000000000000018e-31 < z < -3.60000000000000021e-220 or -6.2000000000000004e-264 < z < 2.3499999999999999e26Initial program 97.3%
associate-+l+97.3%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in x around inf 47.0%
if -3.60000000000000021e-220 < z < -6.2000000000000004e-264Initial program 100.0%
associate-+l+100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around inf 74.0%
if 2.3499999999999999e26 < z Initial program 84.8%
associate-+l+84.8%
associate-*l*76.6%
Simplified76.6%
Taylor expanded in y around inf 51.5%
*-commutative51.5%
Simplified51.5%
Final simplification51.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))))
(if (<= a -3.9e-17)
t_1
(if (<= a 7.1e+53)
(+ x (* z y))
(if (<= a 1.2e+128) t_1 (* b (* z a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double tmp;
if (a <= -3.9e-17) {
tmp = t_1;
} else if (a <= 7.1e+53) {
tmp = x + (z * y);
} else if (a <= 1.2e+128) {
tmp = t_1;
} else {
tmp = b * (z * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (a * t)
if (a <= (-3.9d-17)) then
tmp = t_1
else if (a <= 7.1d+53) then
tmp = x + (z * y)
else if (a <= 1.2d+128) then
tmp = t_1
else
tmp = b * (z * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double tmp;
if (a <= -3.9e-17) {
tmp = t_1;
} else if (a <= 7.1e+53) {
tmp = x + (z * y);
} else if (a <= 1.2e+128) {
tmp = t_1;
} else {
tmp = b * (z * a);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) tmp = 0 if a <= -3.9e-17: tmp = t_1 elif a <= 7.1e+53: tmp = x + (z * y) elif a <= 1.2e+128: tmp = t_1 else: tmp = b * (z * a) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) tmp = 0.0 if (a <= -3.9e-17) tmp = t_1; elseif (a <= 7.1e+53) tmp = Float64(x + Float64(z * y)); elseif (a <= 1.2e+128) tmp = t_1; else tmp = Float64(b * Float64(z * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * t); tmp = 0.0; if (a <= -3.9e-17) tmp = t_1; elseif (a <= 7.1e+53) tmp = x + (z * y); elseif (a <= 1.2e+128) tmp = t_1; else tmp = b * (z * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.9e-17], t$95$1, If[LessEqual[a, 7.1e+53], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e+128], t$95$1, N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;a \leq -3.9 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.1 \cdot 10^{+53}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+128}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\end{array}
\end{array}
if a < -3.89999999999999989e-17 or 7.09999999999999974e53 < a < 1.2000000000000001e128Initial program 93.3%
associate-+l+93.3%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in z around 0 57.0%
+-commutative57.0%
Simplified57.0%
if -3.89999999999999989e-17 < a < 7.09999999999999974e53Initial program 96.3%
associate-+l+96.3%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in a around 0 78.0%
if 1.2000000000000001e128 < a Initial program 70.5%
associate-+l+70.5%
associate-*l*81.0%
Simplified81.0%
*-commutative81.0%
distribute-lft-in89.1%
*-commutative89.1%
add-cube-cbrt88.9%
associate-*l*88.9%
pow288.9%
+-commutative88.9%
fma-define88.9%
+-commutative88.9%
fma-define88.9%
Applied egg-rr88.9%
Taylor expanded in b around inf 53.4%
associate-*r*53.4%
*-commutative53.4%
associate-*r*54.6%
*-commutative54.6%
Simplified54.6%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5e+106) (not (<= b 1.75e-25))) (+ x (* z (+ y (* a b)))) (+ x (+ (* z y) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5e+106) || !(b <= 1.75e-25)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + ((z * y) + (a * 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 ((b <= (-5d+106)) .or. (.not. (b <= 1.75d-25))) then
tmp = x + (z * (y + (a * b)))
else
tmp = x + ((z * y) + (a * 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 ((b <= -5e+106) || !(b <= 1.75e-25)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + ((z * y) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5e+106) or not (b <= 1.75e-25): tmp = x + (z * (y + (a * b))) else: tmp = x + ((z * y) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5e+106) || !(b <= 1.75e-25)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5e+106) || ~((b <= 1.75e-25))) tmp = x + (z * (y + (a * b))); else tmp = x + ((z * y) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5e+106], N[Not[LessEqual[b, 1.75e-25]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+106} \lor \neg \left(b \leq 1.75 \cdot 10^{-25}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\end{array}
\end{array}
if b < -4.9999999999999998e106 or 1.7500000000000001e-25 < b Initial program 88.0%
associate-+l+88.0%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in t around 0 77.1%
+-commutative77.1%
+-commutative77.1%
associate-*r*81.7%
distribute-rgt-in88.2%
Simplified88.2%
if -4.9999999999999998e106 < b < 1.7500000000000001e-25Initial program 94.0%
associate-+l+94.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in b around 0 91.8%
Final simplification90.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.2e-17) (not (<= a 1.8e+22))) (* a (+ t (* z b))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.2e-17) || !(a <= 1.8e+22)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
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 <= (-4.2d-17)) .or. (.not. (a <= 1.8d+22))) then
tmp = a * (t + (z * b))
else
tmp = x + (z * y)
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 <= -4.2e-17) || !(a <= 1.8e+22)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.2e-17) or not (a <= 1.8e+22): tmp = a * (t + (z * b)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.2e-17) || !(a <= 1.8e+22)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4.2e-17) || ~((a <= 1.8e+22))) tmp = a * (t + (z * b)); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.2e-17], N[Not[LessEqual[a, 1.8e+22]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-17} \lor \neg \left(a \leq 1.8 \cdot 10^{+22}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -4.19999999999999984e-17 or 1.8e22 < a Initial program 87.0%
associate-+l+87.0%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in a around inf 74.5%
if -4.19999999999999984e-17 < a < 1.8e22Initial program 96.2%
associate-+l+96.2%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in a around 0 78.9%
Final simplification76.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.5e+114) (not (<= b 1.4e+149))) (* a (* z b)) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.5e+114) || !(b <= 1.4e+149)) {
tmp = a * (z * b);
} else {
tmp = x + (z * y);
}
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 ((b <= (-5.5d+114)) .or. (.not. (b <= 1.4d+149))) then
tmp = a * (z * b)
else
tmp = x + (z * y)
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 ((b <= -5.5e+114) || !(b <= 1.4e+149)) {
tmp = a * (z * b);
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.5e+114) or not (b <= 1.4e+149): tmp = a * (z * b) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.5e+114) || !(b <= 1.4e+149)) tmp = Float64(a * Float64(z * b)); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.5e+114) || ~((b <= 1.4e+149))) tmp = a * (z * b); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.5e+114], N[Not[LessEqual[b, 1.4e+149]], $MachinePrecision]], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{+114} \lor \neg \left(b \leq 1.4 \cdot 10^{+149}\right):\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if b < -5.5000000000000001e114 or 1.4e149 < b Initial program 86.5%
associate-+l+86.5%
associate-*l*79.8%
Simplified79.8%
*-commutative79.8%
distribute-lft-in82.5%
*-commutative82.5%
add-cube-cbrt82.1%
associate-*l*82.1%
pow282.1%
+-commutative82.1%
fma-define82.1%
+-commutative82.1%
fma-define82.1%
Applied egg-rr82.1%
Taylor expanded in b around inf 68.7%
if -5.5000000000000001e114 < b < 1.4e149Initial program 93.5%
associate-+l+93.5%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around 0 63.0%
Final simplification64.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.2e+79) (not (<= t 4.3e+32))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.2e+79) || !(t <= 4.3e+32)) {
tmp = a * t;
} 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 ((t <= (-4.2d+79)) .or. (.not. (t <= 4.3d+32))) then
tmp = a * t
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 ((t <= -4.2e+79) || !(t <= 4.3e+32)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.2e+79) or not (t <= 4.3e+32): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.2e+79) || !(t <= 4.3e+32)) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4.2e+79) || ~((t <= 4.3e+32))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.2e+79], N[Not[LessEqual[t, 4.3e+32]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+79} \lor \neg \left(t \leq 4.3 \cdot 10^{+32}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -4.20000000000000016e79 or 4.2999999999999997e32 < t Initial program 93.1%
associate-+l+93.1%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in t around inf 45.6%
if -4.20000000000000016e79 < t < 4.2999999999999997e32Initial program 90.5%
associate-+l+90.5%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 34.6%
Final simplification38.9%
(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 91.5%
associate-+l+91.5%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around inf 27.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} 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 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
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 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024085
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))