
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (fma x y (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 90.1%
fma-define91.3%
associate-*l*96.8%
Simplified96.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= i -4.2e+70) (not (<= i 5.8e-36)))
(* 2.0 (- t_1 (* i (* c (+ a (* b c))))))
(* 2.0 (- t_1 (* c (+ (* a i) (* b (* c i)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((i <= -4.2e+70) || !(i <= 5.8e-36)) {
tmp = 2.0 * (t_1 - (i * (c * (a + (b * c)))));
} else {
tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (c * i)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((i <= (-4.2d+70)) .or. (.not. (i <= 5.8d-36))) then
tmp = 2.0d0 * (t_1 - (i * (c * (a + (b * c)))))
else
tmp = 2.0d0 * (t_1 - (c * ((a * i) + (b * (c * i)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((i <= -4.2e+70) || !(i <= 5.8e-36)) {
tmp = 2.0 * (t_1 - (i * (c * (a + (b * c)))));
} else {
tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (c * i)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (i <= -4.2e+70) or not (i <= 5.8e-36): tmp = 2.0 * (t_1 - (i * (c * (a + (b * c))))) else: tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (c * i))))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((i <= -4.2e+70) || !(i <= 5.8e-36)) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * Float64(a + Float64(b * c)))))); else tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(Float64(a * i) + Float64(b * Float64(c * i)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((i <= -4.2e+70) || ~((i <= 5.8e-36))) tmp = 2.0 * (t_1 - (i * (c * (a + (b * c))))); else tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (c * i))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[i, -4.2e+70], N[Not[LessEqual[i, 5.8e-36]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(i * N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(c * N[(N[(a * i), $MachinePrecision] + N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;i \leq -4.2 \cdot 10^{+70} \lor \neg \left(i \leq 5.8 \cdot 10^{-36}\right):\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 - c \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if i < -4.20000000000000015e70 or 5.80000000000000026e-36 < i Initial program 96.0%
if -4.20000000000000015e70 < i < 5.80000000000000026e-36Initial program 84.2%
Taylor expanded in c around 0 96.8%
Final simplification96.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= i -8.5e-220) (not (<= i 5.2e-187)))
(* 2.0 (- t_1 (* i (* c (+ a (* b c))))))
(* 2.0 (- t_1 (* c (* a i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((i <= -8.5e-220) || !(i <= 5.2e-187)) {
tmp = 2.0 * (t_1 - (i * (c * (a + (b * c)))));
} else {
tmp = 2.0 * (t_1 - (c * (a * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((i <= (-8.5d-220)) .or. (.not. (i <= 5.2d-187))) then
tmp = 2.0d0 * (t_1 - (i * (c * (a + (b * c)))))
else
tmp = 2.0d0 * (t_1 - (c * (a * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((i <= -8.5e-220) || !(i <= 5.2e-187)) {
tmp = 2.0 * (t_1 - (i * (c * (a + (b * c)))));
} else {
tmp = 2.0 * (t_1 - (c * (a * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (i <= -8.5e-220) or not (i <= 5.2e-187): tmp = 2.0 * (t_1 - (i * (c * (a + (b * c))))) else: tmp = 2.0 * (t_1 - (c * (a * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((i <= -8.5e-220) || !(i <= 5.2e-187)) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * Float64(a + Float64(b * c)))))); else tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(a * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((i <= -8.5e-220) || ~((i <= 5.2e-187))) tmp = 2.0 * (t_1 - (i * (c * (a + (b * c))))); else tmp = 2.0 * (t_1 - (c * (a * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[i, -8.5e-220], N[Not[LessEqual[i, 5.2e-187]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(i * N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;i \leq -8.5 \cdot 10^{-220} \lor \neg \left(i \leq 5.2 \cdot 10^{-187}\right):\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 - c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if i < -8.4999999999999996e-220 or 5.1999999999999999e-187 < i Initial program 94.2%
if -8.4999999999999996e-220 < i < 5.1999999999999999e-187Initial program 63.4%
Taylor expanded in c around 0 100.0%
Taylor expanded in a around inf 96.4%
Final simplification94.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2e+75) (not (<= (* x y) 1e-13))) (* 2.0 (- (+ (* x y) (* z t)) (* a (* c i)))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2e+75) || !((x * y) <= 1e-13)) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-2d+75)) .or. (.not. ((x * y) <= 1d-13))) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
else
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2e+75) || !((x * y) <= 1e-13)) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -2e+75) or not ((x * y) <= 1e-13): tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) else: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -2e+75) || !(Float64(x * y) <= 1e-13)) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -2e+75) || ~(((x * y) <= 1e-13))) tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))); else tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+75], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e-13]], $MachinePrecision]], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+75} \lor \neg \left(x \cdot y \leq 10^{-13}\right):\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999985e75 or 1e-13 < (*.f64 x y) Initial program 87.1%
Taylor expanded in a around inf 84.1%
if -1.99999999999999985e75 < (*.f64 x y) < 1e-13Initial program 92.2%
Taylor expanded in x around 0 91.0%
Final simplification88.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+205)
(* y (* 2.0 x))
(if (<= (* x y) 5e+176)
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* t (* 2.0 (+ z (* x (/ y t))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1e+205) {
tmp = y * (2.0 * x);
} else if ((x * y) <= 5e+176) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = t * (2.0 * (z + (x * (y / t))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-1d+205)) then
tmp = y * (2.0d0 * x)
else if ((x * y) <= 5d+176) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = t * (2.0d0 * (z + (x * (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 c, double i) {
double tmp;
if ((x * y) <= -1e+205) {
tmp = y * (2.0 * x);
} else if ((x * y) <= 5e+176) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = t * (2.0 * (z + (x * (y / t))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1e+205: tmp = y * (2.0 * x) elif (x * y) <= 5e+176: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = t * (2.0 * (z + (x * (y / t)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1e+205) tmp = Float64(y * Float64(2.0 * x)); elseif (Float64(x * y) <= 5e+176) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(t * Float64(2.0 * Float64(z + Float64(x * Float64(y / t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1e+205) tmp = y * (2.0 * x); elseif ((x * y) <= 5e+176) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = t * (2.0 * (z + (x * (y / t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+205], N[(y * N[(2.0 * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+176], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(2.0 * N[(z + N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+205}:\\
\;\;\;\;y \cdot \left(2 \cdot x\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+176}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(2 \cdot \left(z + x \cdot \frac{y}{t}\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000002e205Initial program 79.4%
associate--l+79.4%
*-commutative79.4%
associate--l+79.4%
associate--l+79.4%
*-commutative79.4%
associate--l+79.4%
fma-define84.6%
*-commutative84.6%
associate-*l*94.7%
+-commutative94.7%
fma-define94.7%
Simplified94.7%
Taylor expanded in x around inf 84.9%
*-commutative84.9%
*-commutative84.9%
associate-*r*84.9%
*-commutative84.9%
Simplified84.9%
if -1.00000000000000002e205 < (*.f64 x y) < 5e176Initial program 92.4%
Taylor expanded in x around 0 84.9%
if 5e176 < (*.f64 x y) Initial program 82.4%
Taylor expanded in c around 0 89.6%
Taylor expanded in t around inf 83.0%
distribute-lft-out83.0%
associate-/l*86.1%
Simplified86.1%
Final simplification85.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= a -4.1e+122) (not (<= a 1.85e+92)))
(* 2.0 (- t_1 (* a (* c i))))
(* 2.0 (- t_1 (* c (* b (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a <= -4.1e+122) || !(a <= 1.85e+92)) {
tmp = 2.0 * (t_1 - (a * (c * i)));
} else {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((a <= (-4.1d+122)) .or. (.not. (a <= 1.85d+92))) then
tmp = 2.0d0 * (t_1 - (a * (c * i)))
else
tmp = 2.0d0 * (t_1 - (c * (b * (c * i))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a <= -4.1e+122) || !(a <= 1.85e+92)) {
tmp = 2.0 * (t_1 - (a * (c * i)));
} else {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (a <= -4.1e+122) or not (a <= 1.85e+92): tmp = 2.0 * (t_1 - (a * (c * i))) else: tmp = 2.0 * (t_1 - (c * (b * (c * i)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((a <= -4.1e+122) || !(a <= 1.85e+92)) tmp = Float64(2.0 * Float64(t_1 - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(b * Float64(c * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((a <= -4.1e+122) || ~((a <= 1.85e+92))) tmp = 2.0 * (t_1 - (a * (c * i))); else tmp = 2.0 * (t_1 - (c * (b * (c * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -4.1e+122], N[Not[LessEqual[a, 1.85e+92]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \leq -4.1 \cdot 10^{+122} \lor \neg \left(a \leq 1.85 \cdot 10^{+92}\right):\\
\;\;\;\;2 \cdot \left(t\_1 - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if a < -4.1000000000000002e122 or 1.84999999999999999e92 < a Initial program 88.0%
Taylor expanded in a around inf 89.5%
if -4.1000000000000002e122 < a < 1.84999999999999999e92Initial program 91.2%
Taylor expanded in c around 0 94.0%
Taylor expanded in a around 0 92.1%
Final simplification91.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -9.6e-87) (not (<= c 3.95e-22))) (* (* c (* (+ a (* b c)) i)) -2.0) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -9.6e-87) || !(c <= 3.95e-22)) {
tmp = (c * ((a + (b * c)) * i)) * -2.0;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-9.6d-87)) .or. (.not. (c <= 3.95d-22))) then
tmp = (c * ((a + (b * c)) * i)) * (-2.0d0)
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -9.6e-87) || !(c <= 3.95e-22)) {
tmp = (c * ((a + (b * c)) * i)) * -2.0;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -9.6e-87) or not (c <= 3.95e-22): tmp = (c * ((a + (b * c)) * i)) * -2.0 else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -9.6e-87) || !(c <= 3.95e-22)) tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -9.6e-87) || ~((c <= 3.95e-22))) tmp = (c * ((a + (b * c)) * i)) * -2.0; else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -9.6e-87], N[Not[LessEqual[c, 3.95e-22]], $MachinePrecision]], N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -9.6 \cdot 10^{-87} \lor \neg \left(c \leq 3.95 \cdot 10^{-22}\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -9.5999999999999998e-87 or 3.9499999999999999e-22 < c Initial program 85.1%
associate--l+85.1%
*-commutative85.1%
associate--l+85.1%
associate--l+85.1%
*-commutative85.1%
associate--l+85.1%
fma-define86.3%
*-commutative86.3%
associate-*l*94.4%
+-commutative94.4%
fma-define94.4%
Simplified94.4%
Taylor expanded in i around inf 68.9%
if -9.5999999999999998e-87 < c < 3.9499999999999999e-22Initial program 98.9%
Taylor expanded in c around 0 79.2%
Final simplification72.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= c -7.7e-87)
(* 2.0 (* (* c t_1) (- i)))
(if (<= c 5.6e-24)
(* 2.0 (+ (* x y) (* z t)))
(* (* c (* t_1 i)) -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if (c <= -7.7e-87) {
tmp = 2.0 * ((c * t_1) * -i);
} else if (c <= 5.6e-24) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = (c * (t_1 * i)) * -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = a + (b * c)
if (c <= (-7.7d-87)) then
tmp = 2.0d0 * ((c * t_1) * -i)
else if (c <= 5.6d-24) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = (c * (t_1 * i)) * (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if (c <= -7.7e-87) {
tmp = 2.0 * ((c * t_1) * -i);
} else if (c <= 5.6e-24) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = (c * (t_1 * i)) * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) tmp = 0 if c <= -7.7e-87: tmp = 2.0 * ((c * t_1) * -i) elif c <= 5.6e-24: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = (c * (t_1 * i)) * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (c <= -7.7e-87) tmp = Float64(2.0 * Float64(Float64(c * t_1) * Float64(-i))); elseif (c <= 5.6e-24) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * Float64(t_1 * i)) * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); tmp = 0.0; if (c <= -7.7e-87) tmp = 2.0 * ((c * t_1) * -i); elseif (c <= 5.6e-24) tmp = 2.0 * ((x * y) + (z * t)); else tmp = (c * (t_1 * i)) * -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -7.7e-87], N[(2.0 * N[(N[(c * t$95$1), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.6e-24], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;c \leq -7.7 \cdot 10^{-87}:\\
\;\;\;\;2 \cdot \left(\left(c \cdot t\_1\right) \cdot \left(-i\right)\right)\\
\mathbf{elif}\;c \leq 5.6 \cdot 10^{-24}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(t\_1 \cdot i\right)\right) \cdot -2\\
\end{array}
\end{array}
if c < -7.6999999999999998e-87Initial program 91.9%
Taylor expanded in x around 0 85.0%
Taylor expanded in i around inf 81.6%
Taylor expanded in t around 0 71.6%
if -7.6999999999999998e-87 < c < 5.6000000000000003e-24Initial program 98.9%
Taylor expanded in c around 0 79.2%
if 5.6000000000000003e-24 < c Initial program 77.8%
associate--l+77.8%
*-commutative77.8%
associate--l+77.8%
associate--l+77.8%
*-commutative77.8%
associate--l+77.8%
fma-define80.4%
*-commutative80.4%
associate-*l*91.1%
+-commutative91.1%
fma-define91.1%
Simplified91.1%
Taylor expanded in i around inf 69.6%
Final simplification73.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))))
(if (<= z -9.2e+14)
t_1
(if (<= z -2.85e-246)
(* (* c i) (* a -2.0))
(if (<= z 6.2e-100) (* y (* 2.0 x)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (z <= -9.2e+14) {
tmp = t_1;
} else if (z <= -2.85e-246) {
tmp = (c * i) * (a * -2.0);
} else if (z <= 6.2e-100) {
tmp = y * (2.0 * x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
if (z <= (-9.2d+14)) then
tmp = t_1
else if (z <= (-2.85d-246)) then
tmp = (c * i) * (a * (-2.0d0))
else if (z <= 6.2d-100) then
tmp = y * (2.0d0 * 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 c, double i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (z <= -9.2e+14) {
tmp = t_1;
} else if (z <= -2.85e-246) {
tmp = (c * i) * (a * -2.0);
} else if (z <= 6.2e-100) {
tmp = y * (2.0 * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) tmp = 0 if z <= -9.2e+14: tmp = t_1 elif z <= -2.85e-246: tmp = (c * i) * (a * -2.0) elif z <= 6.2e-100: tmp = y * (2.0 * x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (z <= -9.2e+14) tmp = t_1; elseif (z <= -2.85e-246) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (z <= 6.2e-100) tmp = Float64(y * Float64(2.0 * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); tmp = 0.0; if (z <= -9.2e+14) tmp = t_1; elseif (z <= -2.85e-246) tmp = (c * i) * (a * -2.0); elseif (z <= 6.2e-100) tmp = y * (2.0 * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+14], t$95$1, If[LessEqual[z, -2.85e-246], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e-100], N[(y * N[(2.0 * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.85 \cdot 10^{-246}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-100}:\\
\;\;\;\;y \cdot \left(2 \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.2e14 or 6.1999999999999997e-100 < z Initial program 88.4%
Taylor expanded in z around inf 46.7%
if -9.2e14 < z < -2.84999999999999994e-246Initial program 94.1%
associate--l+94.1%
*-commutative94.1%
associate--l+94.1%
associate--l+94.1%
*-commutative94.1%
associate--l+94.1%
fma-define94.1%
*-commutative94.1%
associate-*l*90.2%
+-commutative90.2%
fma-define90.2%
Simplified90.2%
Taylor expanded in a around inf 34.7%
associate-*r*34.7%
Simplified34.7%
if -2.84999999999999994e-246 < z < 6.1999999999999997e-100Initial program 91.7%
associate--l+91.7%
*-commutative91.7%
associate--l+91.7%
associate--l+91.7%
*-commutative91.7%
associate--l+91.7%
fma-define91.7%
*-commutative91.7%
associate-*l*95.6%
+-commutative95.6%
fma-define95.6%
Simplified95.6%
Taylor expanded in x around inf 29.4%
*-commutative29.4%
*-commutative29.4%
associate-*r*29.4%
*-commutative29.4%
Simplified29.4%
Final simplification41.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))))
(if (<= z -2.8e+17)
t_1
(if (<= z -2.7e-248)
(* -2.0 (* i (* a c)))
(if (<= z 1.7e-94) (* y (* 2.0 x)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (z <= -2.8e+17) {
tmp = t_1;
} else if (z <= -2.7e-248) {
tmp = -2.0 * (i * (a * c));
} else if (z <= 1.7e-94) {
tmp = y * (2.0 * x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
if (z <= (-2.8d+17)) then
tmp = t_1
else if (z <= (-2.7d-248)) then
tmp = (-2.0d0) * (i * (a * c))
else if (z <= 1.7d-94) then
tmp = y * (2.0d0 * 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 c, double i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (z <= -2.8e+17) {
tmp = t_1;
} else if (z <= -2.7e-248) {
tmp = -2.0 * (i * (a * c));
} else if (z <= 1.7e-94) {
tmp = y * (2.0 * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) tmp = 0 if z <= -2.8e+17: tmp = t_1 elif z <= -2.7e-248: tmp = -2.0 * (i * (a * c)) elif z <= 1.7e-94: tmp = y * (2.0 * x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (z <= -2.8e+17) tmp = t_1; elseif (z <= -2.7e-248) tmp = Float64(-2.0 * Float64(i * Float64(a * c))); elseif (z <= 1.7e-94) tmp = Float64(y * Float64(2.0 * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); tmp = 0.0; if (z <= -2.8e+17) tmp = t_1; elseif (z <= -2.7e-248) tmp = -2.0 * (i * (a * c)); elseif (z <= 1.7e-94) tmp = y * (2.0 * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e+17], t$95$1, If[LessEqual[z, -2.7e-248], N[(-2.0 * N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-94], N[(y * N[(2.0 * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-248}:\\
\;\;\;\;-2 \cdot \left(i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-94}:\\
\;\;\;\;y \cdot \left(2 \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8e17 or 1.6999999999999999e-94 < z Initial program 88.4%
Taylor expanded in z around inf 46.7%
if -2.8e17 < z < -2.7000000000000001e-248Initial program 94.1%
associate--l+94.1%
*-commutative94.1%
associate--l+94.1%
associate--l+94.1%
*-commutative94.1%
associate--l+94.1%
fma-define94.1%
*-commutative94.1%
associate-*l*90.2%
+-commutative90.2%
fma-define90.2%
Simplified90.2%
Taylor expanded in a around inf 34.7%
*-commutative34.7%
*-commutative34.7%
associate-*l*31.0%
*-commutative31.0%
associate-*r*31.0%
*-commutative31.0%
associate-*l*31.0%
Simplified31.0%
Taylor expanded in c around 0 34.7%
*-commutative34.7%
associate-*r*31.0%
*-commutative31.0%
associate-*l*34.7%
Simplified34.7%
if -2.7000000000000001e-248 < z < 1.6999999999999999e-94Initial program 91.7%
associate--l+91.7%
*-commutative91.7%
associate--l+91.7%
associate--l+91.7%
*-commutative91.7%
associate--l+91.7%
fma-define91.7%
*-commutative91.7%
associate-*l*95.6%
+-commutative95.6%
fma-define95.6%
Simplified95.6%
Taylor expanded in x around inf 29.4%
*-commutative29.4%
*-commutative29.4%
associate-*r*29.4%
*-commutative29.4%
Simplified29.4%
Final simplification41.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a -4.2e+248) (* -2.0 (* i (* a c))) (if (<= a 6.8e+93) (* 2.0 (+ (* x y) (* z t))) (* (* c i) (* a -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -4.2e+248) {
tmp = -2.0 * (i * (a * c));
} else if (a <= 6.8e+93) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = (c * i) * (a * -2.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (a <= (-4.2d+248)) then
tmp = (-2.0d0) * (i * (a * c))
else if (a <= 6.8d+93) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = (c * i) * (a * (-2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -4.2e+248) {
tmp = -2.0 * (i * (a * c));
} else if (a <= 6.8e+93) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = (c * i) * (a * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= -4.2e+248: tmp = -2.0 * (i * (a * c)) elif a <= 6.8e+93: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = (c * i) * (a * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= -4.2e+248) tmp = Float64(-2.0 * Float64(i * Float64(a * c))); elseif (a <= 6.8e+93) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * i) * Float64(a * -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= -4.2e+248) tmp = -2.0 * (i * (a * c)); elseif (a <= 6.8e+93) tmp = 2.0 * ((x * y) + (z * t)); else tmp = (c * i) * (a * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, -4.2e+248], N[(-2.0 * N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.8e+93], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{+248}:\\
\;\;\;\;-2 \cdot \left(i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{+93}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\end{array}
\end{array}
if a < -4.19999999999999977e248Initial program 93.9%
associate--l+93.9%
*-commutative93.9%
associate--l+93.9%
associate--l+93.9%
*-commutative93.9%
associate--l+93.9%
fma-define99.8%
*-commutative99.8%
associate-*l*89.1%
+-commutative89.1%
fma-define89.1%
Simplified89.1%
Taylor expanded in a around inf 65.3%
*-commutative65.3%
*-commutative65.3%
associate-*l*60.1%
*-commutative60.1%
associate-*r*60.1%
*-commutative60.1%
associate-*l*60.1%
Simplified60.1%
Taylor expanded in c around 0 65.3%
*-commutative65.3%
associate-*r*60.1%
*-commutative60.1%
associate-*l*70.8%
Simplified70.8%
if -4.19999999999999977e248 < a < 6.8000000000000001e93Initial program 90.4%
Taylor expanded in c around 0 60.3%
if 6.8000000000000001e93 < a Initial program 87.6%
associate--l+87.6%
*-commutative87.6%
associate--l+87.6%
associate--l+87.6%
*-commutative87.6%
associate--l+87.6%
fma-define87.6%
*-commutative87.6%
associate-*l*91.6%
+-commutative91.6%
fma-define91.6%
Simplified91.6%
Taylor expanded in a around inf 64.2%
associate-*r*64.2%
Simplified64.2%
Final simplification61.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -4.8e-49) (not (<= z 3.7e-97))) (* 2.0 (* z t)) (* y (* 2.0 x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -4.8e-49) || !(z <= 3.7e-97)) {
tmp = 2.0 * (z * t);
} else {
tmp = y * (2.0 * x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((z <= (-4.8d-49)) .or. (.not. (z <= 3.7d-97))) then
tmp = 2.0d0 * (z * t)
else
tmp = y * (2.0d0 * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -4.8e-49) || !(z <= 3.7e-97)) {
tmp = 2.0 * (z * t);
} else {
tmp = y * (2.0 * x);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -4.8e-49) or not (z <= 3.7e-97): tmp = 2.0 * (z * t) else: tmp = y * (2.0 * x) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -4.8e-49) || !(z <= 3.7e-97)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(y * Float64(2.0 * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z <= -4.8e-49) || ~((z <= 3.7e-97))) tmp = 2.0 * (z * t); else tmp = y * (2.0 * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -4.8e-49], N[Not[LessEqual[z, 3.7e-97]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(y * N[(2.0 * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-49} \lor \neg \left(z \leq 3.7 \cdot 10^{-97}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(2 \cdot x\right)\\
\end{array}
\end{array}
if z < -4.79999999999999985e-49 or 3.69999999999999976e-97 < z Initial program 89.2%
Taylor expanded in z around inf 45.4%
if -4.79999999999999985e-49 < z < 3.69999999999999976e-97Initial program 91.9%
associate--l+91.9%
*-commutative91.9%
associate--l+91.9%
associate--l+91.9%
*-commutative91.9%
associate--l+91.9%
fma-define91.9%
*-commutative91.9%
associate-*l*94.0%
+-commutative94.0%
fma-define94.0%
Simplified94.0%
Taylor expanded in x around inf 28.7%
*-commutative28.7%
*-commutative28.7%
associate-*r*28.7%
*-commutative28.7%
Simplified28.7%
Final simplification39.9%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 90.1%
Taylor expanded in z around inf 33.7%
Final simplification33.7%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024123
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))