
(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 11 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
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* (* b (* i (pow c 2.0))) -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 ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = (b * (i * pow(c, 2.0))) * -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 (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(Float64(b * Float64(i * (c ^ 2.0))) * -2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(i * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot \left(i \cdot {c}^{2}\right)\right) \cdot -2\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 96.7%
fma-def96.7%
associate-*l*99.5%
Simplified99.5%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
fma-def0.0%
*-commutative0.0%
associate-*l*6.3%
+-commutative6.3%
fma-def6.3%
Simplified6.3%
Taylor expanded in c around inf 75.0%
*-commutative75.0%
Simplified75.0%
Final simplification97.9%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)))) (if (<= t_1 INFINITY) (* t_1 2.0) (* (* b (* i (pow c 2.0))) -2.0))))
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)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 2.0;
} else {
tmp = (b * (i * pow(c, 2.0))) * -2.0;
}
return tmp;
}
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)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * 2.0;
} else {
tmp = (b * (i * Math.pow(c, 2.0))) * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 * 2.0 else: tmp = (b * (i * math.pow(c, 2.0))) * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(t_1 * 2.0); else tmp = Float64(Float64(b * Float64(i * (c ^ 2.0))) * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1 * 2.0; else tmp = (b * (i * (c ^ 2.0))) * -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(t$95$1 * 2.0), $MachinePrecision], N[(N[(b * N[(i * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot \left(i \cdot {c}^{2}\right)\right) \cdot -2\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 96.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
fma-def0.0%
*-commutative0.0%
associate-*l*6.3%
+-commutative6.3%
fma-def6.3%
Simplified6.3%
Taylor expanded in c around inf 75.0%
*-commutative75.0%
Simplified75.0%
Final simplification95.4%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ a (* b c))) (t_2 (- (+ (* x y) (* z t)) (* (* c t_1) i)))) (if (<= t_2 INFINITY) (* t_2 2.0) (* -2.0 (* c (* t_1 i))))))
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 t_2 = ((x * y) + (z * t)) - ((c * t_1) * i);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2 * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
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 t_2 = ((x * y) + (z * t)) - ((c * t_1) * i);
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2 * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = ((x * y) + (z * t)) - ((c * t_1) * i) tmp = 0 if t_2 <= math.inf: tmp = t_2 * 2.0 else: tmp = -2.0 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) tmp = 0.0 if (t_2 <= Inf) tmp = Float64(t_2 * 2.0); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = ((x * y) + (z * t)) - ((c * t_1) * i); tmp = 0.0; if (t_2 <= Inf) tmp = t_2 * 2.0; else tmp = -2.0 * (c * (t_1 * i)); 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]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], N[(t$95$2 * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 96.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
fma-def0.0%
*-commutative0.0%
associate-*l*6.3%
+-commutative6.3%
fma-def6.3%
Simplified6.3%
Taylor expanded in i around inf 75.0%
Final simplification95.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -13000000.0)
t_1
(if (<= c 2850000.0)
(* (+ (* x y) (* z t)) 2.0)
(if (or (<= c 8.8e+93) (not (<= c 1.46e+140)))
t_1
(* 2.0 (- (* z t) (* 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 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -13000000.0) {
tmp = t_1;
} else if (c <= 2850000.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((c <= 8.8e+93) || !(c <= 1.46e+140)) {
tmp = t_1;
} else {
tmp = 2.0 * ((z * t) - (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 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-13000000.0d0)) then
tmp = t_1
else if (c <= 2850000.0d0) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if ((c <= 8.8d+93) .or. (.not. (c <= 1.46d+140))) then
tmp = t_1
else
tmp = 2.0d0 * ((z * t) - (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 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -13000000.0) {
tmp = t_1;
} else if (c <= 2850000.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((c <= 8.8e+93) || !(c <= 1.46e+140)) {
tmp = t_1;
} else {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -13000000.0: tmp = t_1 elif c <= 2850000.0: tmp = ((x * y) + (z * t)) * 2.0 elif (c <= 8.8e+93) or not (c <= 1.46e+140): tmp = t_1 else: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -13000000.0) tmp = t_1; elseif (c <= 2850000.0) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif ((c <= 8.8e+93) || !(c <= 1.46e+140)) tmp = t_1; else tmp = Float64(2.0 * Float64(Float64(z * t) - 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 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -13000000.0) tmp = t_1; elseif (c <= 2850000.0) tmp = ((x * y) + (z * t)) * 2.0; elseif ((c <= 8.8e+93) || ~((c <= 1.46e+140))) tmp = t_1; else tmp = 2.0 * ((z * t) - (c * (b * (c * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -13000000.0], t$95$1, If[LessEqual[c, 2850000.0], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[Or[LessEqual[c, 8.8e+93], N[Not[LessEqual[c, 1.46e+140]], $MachinePrecision]], t$95$1, N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -13000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2850000:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 8.8 \cdot 10^{+93} \lor \neg \left(c \leq 1.46 \cdot 10^{+140}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -1.3e7 or 2.85e6 < c < 8.80000000000000084e93 or 1.45999999999999996e140 < c Initial program 84.0%
associate--l+84.0%
*-commutative84.0%
associate--l+84.0%
associate--l+84.0%
*-commutative84.0%
associate--l+84.0%
fma-def84.0%
*-commutative84.0%
associate-*l*87.8%
+-commutative87.8%
fma-def87.8%
Simplified87.8%
Taylor expanded in i around inf 81.1%
if -1.3e7 < c < 2.85e6Initial program 99.9%
Taylor expanded in c around 0 79.6%
if 8.80000000000000084e93 < c < 1.45999999999999996e140Initial program 73.9%
Taylor expanded in x around 0 66.9%
Taylor expanded in a around 0 73.5%
Final simplification80.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -10500000.0)
(and (not (<= c 240000.0))
(or (<= c 1.56e+116) (not (<= c 1.35e+140)))))
(* -2.0 (* c (* (+ a (* b c)) i)))
(* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -10500000.0) || (!(c <= 240000.0) && ((c <= 1.56e+116) || !(c <= 1.35e+140)))) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 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 ((c <= (-10500000.0d0)) .or. (.not. (c <= 240000.0d0)) .and. (c <= 1.56d+116) .or. (.not. (c <= 1.35d+140))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = ((x * y) + (z * t)) * 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 ((c <= -10500000.0) || (!(c <= 240000.0) && ((c <= 1.56e+116) || !(c <= 1.35e+140)))) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -10500000.0) or (not (c <= 240000.0) and ((c <= 1.56e+116) or not (c <= 1.35e+140))): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -10500000.0) || (!(c <= 240000.0) && ((c <= 1.56e+116) || !(c <= 1.35e+140)))) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -10500000.0) || (~((c <= 240000.0)) && ((c <= 1.56e+116) || ~((c <= 1.35e+140))))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -10500000.0], And[N[Not[LessEqual[c, 240000.0]], $MachinePrecision], Or[LessEqual[c, 1.56e+116], N[Not[LessEqual[c, 1.35e+140]], $MachinePrecision]]]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -10500000 \lor \neg \left(c \leq 240000\right) \land \left(c \leq 1.56 \cdot 10^{+116} \lor \neg \left(c \leq 1.35 \cdot 10^{+140}\right)\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.05e7 or 2.4e5 < c < 1.56000000000000002e116 or 1.35000000000000009e140 < c Initial program 84.4%
associate--l+84.4%
*-commutative84.4%
associate--l+84.4%
associate--l+84.4%
*-commutative84.4%
associate--l+84.4%
fma-def84.4%
*-commutative84.4%
associate-*l*88.1%
+-commutative88.1%
fma-def88.1%
Simplified88.1%
Taylor expanded in i around inf 80.8%
if -1.05e7 < c < 2.4e5 or 1.56000000000000002e116 < c < 1.35000000000000009e140Initial program 96.9%
Taylor expanded in c around 0 78.5%
Final simplification79.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.8e-93) (not (<= c 300000.0))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.8e-93) || !(c <= 300000.0)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 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 ((c <= (-2.8d-93)) .or. (.not. (c <= 300000.0d0))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = ((x * y) + (z * t)) * 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 ((c <= -2.8e-93) || !(c <= 300000.0)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.8e-93) or not (c <= 300000.0): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.8e-93) || !(c <= 300000.0)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.8e-93) || ~((c <= 300000.0))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.8e-93], N[Not[LessEqual[c, 300000.0]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.8 \cdot 10^{-93} \lor \neg \left(c \leq 300000\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.79999999999999998e-93 or 3e5 < c Initial program 84.4%
Taylor expanded in x around 0 79.2%
if -2.79999999999999998e-93 < c < 3e5Initial program 100.0%
Taylor expanded in c around 0 82.9%
Final simplification80.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -8.8e-94)
(* 2.0 (- (* z t) t_1))
(if (<= c 1.55e-36)
(* (+ (* x y) (* z t)) 2.0)
(* 2.0 (- (* x y) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -8.8e-94) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 1.55e-36) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - 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 = c * ((a + (b * c)) * i)
if (c <= (-8.8d-94)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 1.55d-36) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((x * y) - 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 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -8.8e-94) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 1.55e-36) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -8.8e-94: tmp = 2.0 * ((z * t) - t_1) elif c <= 1.55e-36: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((x * y) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -8.8e-94) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 1.55e-36) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -8.8e-94) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 1.55e-36) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * ((x * y) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.8e-94], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.55e-36], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -8.8 \cdot 10^{-94}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 1.55 \cdot 10^{-36}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\end{array}
\end{array}
if c < -8.80000000000000004e-94Initial program 86.2%
Taylor expanded in x around 0 80.2%
if -8.80000000000000004e-94 < c < 1.5499999999999999e-36Initial program 100.0%
Taylor expanded in c around 0 85.5%
if 1.5499999999999999e-36 < c Initial program 84.2%
Taylor expanded in z around 0 87.7%
Final simplification84.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -3e+25)
(* 2.0 (- (* z t) t_1))
(if (<= c 5.1e-30)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* 2.0 (- (* x y) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -3e+25) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 5.1e-30) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - 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 = c * ((a + (b * c)) * i)
if (c <= (-3d+25)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 5.1d-30) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else
tmp = 2.0d0 * ((x * y) - 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 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -3e+25) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 5.1e-30) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -3e+25: tmp = 2.0 * ((z * t) - t_1) elif c <= 5.1e-30: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = 2.0 * ((x * y) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -3e+25) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 5.1e-30) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -3e+25) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 5.1e-30) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); else tmp = 2.0 * ((x * y) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3e+25], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.1e-30], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -3 \cdot 10^{+25}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 5.1 \cdot 10^{-30}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\end{array}
\end{array}
if c < -3.00000000000000006e25Initial program 82.6%
Taylor expanded in x around 0 82.5%
if -3.00000000000000006e25 < c < 5.09999999999999972e-30Initial program 99.9%
Taylor expanded in a around inf 92.3%
*-commutative92.3%
Simplified92.3%
if 5.09999999999999972e-30 < c Initial program 84.2%
Taylor expanded in z around 0 87.7%
Final simplification88.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= i -1.02e+155) (* -2.0 (* a (* c i))) (if (<= i 7.8e+213) (* (+ (* x y) (* z t)) 2.0) (* 2.0 (* i (* a (- c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= -1.02e+155) {
tmp = -2.0 * (a * (c * i));
} else if (i <= 7.8e+213) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * (i * (a * -c));
}
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 (i <= (-1.02d+155)) then
tmp = (-2.0d0) * (a * (c * i))
else if (i <= 7.8d+213) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * (i * (a * -c))
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 (i <= -1.02e+155) {
tmp = -2.0 * (a * (c * i));
} else if (i <= 7.8e+213) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * (i * (a * -c));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if i <= -1.02e+155: tmp = -2.0 * (a * (c * i)) elif i <= 7.8e+213: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * (i * (a * -c)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (i <= -1.02e+155) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (i <= 7.8e+213) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(i * Float64(a * Float64(-c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (i <= -1.02e+155) tmp = -2.0 * (a * (c * i)); elseif (i <= 7.8e+213) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * (i * (a * -c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, -1.02e+155], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.8e+213], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(i * N[(a * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.02 \cdot 10^{+155}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;i \leq 7.8 \cdot 10^{+213}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\
\end{array}
\end{array}
if i < -1.02e155Initial program 99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
fma-def99.9%
*-commutative99.9%
associate-*l*88.1%
+-commutative88.1%
fma-def88.1%
Simplified88.1%
Taylor expanded in a around inf 56.5%
if -1.02e155 < i < 7.8000000000000003e213Initial program 90.7%
Taylor expanded in c around 0 61.5%
if 7.8000000000000003e213 < i Initial program 82.6%
associate-*r*82.5%
*-commutative82.5%
+-commutative82.5%
distribute-lft-in61.9%
Applied egg-rr61.9%
expm1-log1p-u40.6%
expm1-udef40.6%
associate-*l*34.7%
*-commutative34.7%
Applied egg-rr34.7%
expm1-def34.7%
expm1-log1p52.3%
associate-*r*52.3%
*-commutative52.3%
associate-*l*42.3%
Simplified42.3%
Taylor expanded in a around inf 46.1%
associate-*r*46.1%
*-commutative46.1%
*-commutative46.1%
associate-*r*46.1%
neg-mul-146.1%
Simplified46.1%
Final simplification59.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -3.4e+117) (not (<= x 8e-94))) (* x (* y 2.0)) (* t (* z 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -3.4e+117) || !(x <= 8e-94)) {
tmp = x * (y * 2.0);
} else {
tmp = t * (z * 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 ((x <= (-3.4d+117)) .or. (.not. (x <= 8d-94))) then
tmp = x * (y * 2.0d0)
else
tmp = t * (z * 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 ((x <= -3.4e+117) || !(x <= 8e-94)) {
tmp = x * (y * 2.0);
} else {
tmp = t * (z * 2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -3.4e+117) or not (x <= 8e-94): tmp = x * (y * 2.0) else: tmp = t * (z * 2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -3.4e+117) || !(x <= 8e-94)) tmp = Float64(x * Float64(y * 2.0)); else tmp = Float64(t * Float64(z * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -3.4e+117) || ~((x <= 8e-94))) tmp = x * (y * 2.0); else tmp = t * (z * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -3.4e+117], N[Not[LessEqual[x, 8e-94]], $MachinePrecision]], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+117} \lor \neg \left(x \leq 8 \cdot 10^{-94}\right):\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\end{array}
\end{array}
if x < -3.4000000000000001e117 or 7.9999999999999996e-94 < x Initial program 86.9%
associate--l+86.9%
*-commutative86.9%
associate--l+86.9%
associate--l+86.9%
*-commutative86.9%
associate--l+86.9%
fma-def86.9%
*-commutative86.9%
associate-*l*84.7%
+-commutative84.7%
fma-def84.7%
Simplified84.7%
Taylor expanded in x around inf 41.7%
*-commutative41.7%
associate-*l*41.7%
Simplified41.7%
if -3.4000000000000001e117 < x < 7.9999999999999996e-94Initial program 94.6%
associate--l+94.6%
*-commutative94.6%
associate--l+94.6%
associate--l+94.6%
*-commutative94.6%
associate--l+94.6%
fma-def94.6%
*-commutative94.6%
associate-*l*87.7%
+-commutative87.7%
fma-def87.7%
Simplified87.7%
Taylor expanded in z around inf 36.0%
*-commutative36.0%
associate-*l*36.0%
Simplified36.0%
Final simplification38.9%
(FPCore (x y z t a b c i) :precision binary64 (* t (* z 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
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 = t * (z * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
def code(x, y, z, t, a, b, c, i): return t * (z * 2.0)
function code(x, y, z, t, a, b, c, i) return Float64(t * Float64(z * 2.0)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t * (z * 2.0); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(z \cdot 2\right)
\end{array}
Initial program 90.7%
associate--l+90.7%
*-commutative90.7%
associate--l+90.7%
associate--l+90.7%
*-commutative90.7%
associate--l+90.7%
fma-def90.7%
*-commutative90.7%
associate-*l*86.2%
+-commutative86.2%
fma-def86.2%
Simplified86.2%
Taylor expanded in z around inf 27.7%
*-commutative27.7%
associate-*l*27.7%
Simplified27.7%
Final simplification27.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 2024031
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))