
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (fma y x (* -0.25 (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = fma(y, x, (-0.25 * (a * b)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = fma(y, x, Float64(-0.25 * Float64(a * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(y * x + N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, -0.25 \cdot \left(a \cdot b\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in z around 0 60.0%
Taylor expanded in c around 0 60.0%
*-commutative60.0%
fma-neg80.0%
*-commutative80.0%
distribute-rgt-neg-in80.0%
metadata-eval80.0%
Applied egg-rr80.0%
Final simplification99.6%
(FPCore (x y z t a b c) :precision binary64 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Initial program 98.0%
associate-+l-98.0%
associate--l+98.0%
fma-def98.8%
associate-*l/98.8%
fma-neg99.2%
sub-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
associate-/l*99.2%
distribute-frac-neg99.2%
associate-/r/99.2%
fma-def99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (+ c (+ (* x y) (fma z (* t 0.0625) (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((x * y) + fma(z, (t * 0.0625), (a * (b * -0.25))));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(x * y) + fma(z, Float64(t * 0.0625), Float64(a * Float64(b * -0.25))))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y), $MachinePrecision] + N[(z * N[(t * 0.0625), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(x \cdot y + \mathsf{fma}\left(z, t \cdot 0.0625, a \cdot \left(b \cdot -0.25\right)\right)\right)
\end{array}
Initial program 98.0%
associate--l+98.0%
associate-/l*97.9%
div-inv98.0%
fma-neg98.4%
clear-num98.4%
div-inv98.4%
metadata-eval98.4%
associate-/l*98.3%
associate-/r/98.4%
distribute-lft-neg-in98.4%
distribute-frac-neg98.4%
metadata-eval98.4%
frac-2neg98.4%
div-inv98.4%
associate-*l*98.4%
metadata-eval98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* x y) -1.45e+87)
(- (+ c (* x y)) t_1)
(if (<= (* x y) 1.46e-55) (- (+ c t_2) t_1) (+ c (+ (* x y) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -1.45e+87) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 1.46e-55) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((x * y) <= (-1.45d+87)) then
tmp = (c + (x * y)) - t_1
else if ((x * y) <= 1.46d-55) then
tmp = (c + t_2) - t_1
else
tmp = c + ((x * y) + t_2)
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 t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -1.45e+87) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 1.46e-55) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -1.45e+87: tmp = (c + (x * y)) - t_1 elif (x * y) <= 1.46e-55: tmp = (c + t_2) - t_1 else: tmp = c + ((x * y) + t_2) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -1.45e+87) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(x * y) <= 1.46e-55) tmp = Float64(Float64(c + t_2) - t_1); else tmp = Float64(c + Float64(Float64(x * y) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if ((x * y) <= -1.45e+87) tmp = (c + (x * y)) - t_1; elseif ((x * y) <= 1.46e-55) tmp = (c + t_2) - t_1; else tmp = c + ((x * y) + t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.45e+87], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.46e-55], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -1.45 \cdot 10^{+87}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{elif}\;x \cdot y \leq 1.46 \cdot 10^{-55}:\\
\;\;\;\;\left(c + t_2\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.4499999999999999e87Initial program 94.6%
Taylor expanded in z around 0 89.7%
if -1.4499999999999999e87 < (*.f64 x y) < 1.46000000000000009e-55Initial program 100.0%
Taylor expanded in x around 0 97.0%
if 1.46000000000000009e-55 < (*.f64 x y) Initial program 96.8%
Taylor expanded in a around 0 86.9%
Final simplification92.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+133) (not (<= (* a b) 5e+97))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+133) || !((a * b) <= 5e+97)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((a * b) <= (-5d+133)) .or. (.not. ((a * b) <= 5d+97))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (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 tmp;
if (((a * b) <= -5e+133) || !((a * b) <= 5e+97)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -5e+133) or not ((a * b) <= 5e+97): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -5e+133) || !(Float64(a * b) <= 5e+97)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -5e+133) || ~(((a * b) <= 5e+97))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+133], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+97]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+133} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+97}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999961e133 or 4.99999999999999999e97 < (*.f64 a b) Initial program 97.0%
Taylor expanded in z around 0 87.2%
if -4.99999999999999961e133 < (*.f64 a b) < 4.99999999999999999e97Initial program 98.3%
Taylor expanded in a around 0 93.3%
Final simplification91.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+162)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) 2e+212)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(* -0.25 (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+162) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 2e+212) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = -0.25 * (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if ((a * b) <= (-5d+162)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= 2d+212) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (-0.25d0) * (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 c) {
double tmp;
if ((a * b) <= -5e+162) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 2e+212) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = -0.25 * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+162: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= 2e+212: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = -0.25 * (a * b) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -5e+162) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 2e+212) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(-0.25 * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -5e+162) tmp = (x * y) - ((a * b) * 0.25); elseif ((a * b) <= 2e+212) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = -0.25 * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+162], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+212], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+162}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+212}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999997e162Initial program 96.3%
Taylor expanded in z around 0 89.2%
Taylor expanded in c around 0 89.5%
if -4.9999999999999997e162 < (*.f64 a b) < 1.9999999999999998e212Initial program 98.5%
Taylor expanded in a around 0 90.9%
if 1.9999999999999998e212 < (*.f64 a b) Initial program 94.4%
Taylor expanded in x around 0 100.0%
Taylor expanded in a around inf 95.0%
*-commutative95.0%
Simplified95.0%
Final simplification91.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -5e+162)
(- (* x y) t_1)
(if (<= (* a b) 2e+212) (+ c (+ (* x y) t_2)) (- t_2 t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+162) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 2e+212) {
tmp = c + ((x * y) + t_2);
} else {
tmp = t_2 - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-5d+162)) then
tmp = (x * y) - t_1
else if ((a * b) <= 2d+212) then
tmp = c + ((x * y) + t_2)
else
tmp = t_2 - 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 t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+162) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 2e+212) {
tmp = c + ((x * y) + t_2);
} else {
tmp = t_2 - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -5e+162: tmp = (x * y) - t_1 elif (a * b) <= 2e+212: tmp = c + ((x * y) + t_2) else: tmp = t_2 - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -5e+162) tmp = Float64(Float64(x * y) - t_1); elseif (Float64(a * b) <= 2e+212) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(t_2 - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -5e+162) tmp = (x * y) - t_1; elseif ((a * b) <= 2e+212) tmp = c + ((x * y) + t_2); else tmp = t_2 - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+162], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+212], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+162}:\\
\;\;\;\;x \cdot y - t_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+212}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999997e162Initial program 96.3%
Taylor expanded in z around 0 89.2%
Taylor expanded in c around 0 89.5%
if -4.9999999999999997e162 < (*.f64 a b) < 1.9999999999999998e212Initial program 98.5%
Taylor expanded in a around 0 90.9%
if 1.9999999999999998e212 < (*.f64 a b) Initial program 94.4%
Taylor expanded in x around 0 100.0%
Taylor expanded in c around 0 100.0%
Final simplification91.4%
(FPCore (x y z t a b c) :precision binary64 (+ c (+ (* x y) (- (/ z (/ 16.0 t)) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((x * y) + ((z / (16.0 / t)) - ((a * b) * 0.25)));
}
real(8) function code(x, y, z, t, a, b, c)
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
code = c + ((x * y) + ((z / (16.0d0 / t)) - ((a * b) * 0.25d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((x * y) + ((z / (16.0 / t)) - ((a * b) * 0.25)));
}
def code(x, y, z, t, a, b, c): return c + ((x * y) + ((z / (16.0 / t)) - ((a * b) * 0.25)))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(x * y) + Float64(Float64(z / Float64(16.0 / t)) - Float64(Float64(a * b) * 0.25)))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + ((x * y) + ((z / (16.0 / t)) - ((a * b) * 0.25))); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z / N[(16.0 / t), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(x \cdot y + \left(\frac{z}{\frac{16}{t}} - \left(a \cdot b\right) \cdot 0.25\right)\right)
\end{array}
Initial program 98.0%
associate-/l*97.9%
add-cube-cbrt97.6%
div-inv97.6%
times-frac97.6%
pow297.6%
Applied egg-rr97.6%
associate-/r/97.6%
/-rgt-identity97.6%
associate-*r*97.6%
associate-*l/97.6%
unpow297.6%
rem-3cbrt-lft98.0%
associate-/r/97.9%
Simplified97.9%
associate--l+97.9%
div-inv97.9%
metadata-eval97.9%
*-commutative97.9%
Applied egg-rr97.9%
Final simplification97.9%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
real(8) function code(x, y, z, t, a, b, c)
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
code = c + (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.05e+76) (not (<= (* x y) 1.55e+68))) (+ c (* x y)) (+ c (* a (* b -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.05e+76) || !((x * y) <= 1.55e+68)) {
tmp = c + (x * y);
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((x * y) <= (-1.05d+76)) .or. (.not. ((x * y) <= 1.55d+68))) then
tmp = c + (x * y)
else
tmp = c + (a * (b * (-0.25d0)))
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 tmp;
if (((x * y) <= -1.05e+76) || !((x * y) <= 1.55e+68)) {
tmp = c + (x * y);
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.05e+76) or not ((x * y) <= 1.55e+68): tmp = c + (x * y) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.05e+76) || !(Float64(x * y) <= 1.55e+68)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1.05e+76) || ~(((x * y) <= 1.55e+68))) tmp = c + (x * y); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.05e+76], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.55e+68]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+76} \lor \neg \left(x \cdot y \leq 1.55 \cdot 10^{+68}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.05000000000000003e76 or 1.5499999999999999e68 < (*.f64 x y) Initial program 95.2%
associate--l+95.2%
associate-/l*95.2%
div-inv95.2%
fma-neg96.2%
clear-num96.2%
div-inv96.2%
metadata-eval96.2%
associate-/l*96.2%
associate-/r/96.2%
distribute-lft-neg-in96.2%
distribute-frac-neg96.2%
metadata-eval96.2%
frac-2neg96.2%
div-inv96.2%
associate-*l*96.2%
metadata-eval96.2%
Applied egg-rr96.2%
Taylor expanded in x around inf 78.1%
if -1.05000000000000003e76 < (*.f64 x y) < 1.5499999999999999e68Initial program 99.9%
Taylor expanded in a around inf 54.3%
*-commutative54.3%
associate-*r*54.3%
Simplified54.3%
Final simplification64.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.5e+89) (not (<= (* x y) 1e+51))) (+ c (* x y)) (+ c (* z (* t 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2.5e+89) || !((x * y) <= 1e+51)) {
tmp = c + (x * y);
} else {
tmp = c + (z * (t * 0.0625));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((x * y) <= (-2.5d+89)) .or. (.not. ((x * y) <= 1d+51))) then
tmp = c + (x * y)
else
tmp = c + (z * (t * 0.0625d0))
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 tmp;
if (((x * y) <= -2.5e+89) || !((x * y) <= 1e+51)) {
tmp = c + (x * y);
} else {
tmp = c + (z * (t * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.5e+89) or not ((x * y) <= 1e+51): tmp = c + (x * y) else: tmp = c + (z * (t * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2.5e+89) || !(Float64(x * y) <= 1e+51)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(z * Float64(t * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -2.5e+89) || ~(((x * y) <= 1e+51))) tmp = c + (x * y); else tmp = c + (z * (t * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.5e+89], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+51]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.5 \cdot 10^{+89} \lor \neg \left(x \cdot y \leq 10^{+51}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.49999999999999992e89 or 1e51 < (*.f64 x y) Initial program 95.1%
associate--l+95.1%
associate-/l*95.1%
div-inv95.1%
fma-neg96.1%
clear-num96.1%
div-inv96.1%
metadata-eval96.1%
associate-/l*96.1%
associate-/r/96.1%
distribute-lft-neg-in96.1%
distribute-frac-neg96.1%
metadata-eval96.1%
frac-2neg96.1%
div-inv96.1%
associate-*l*96.1%
metadata-eval96.1%
Applied egg-rr96.1%
Taylor expanded in x around inf 79.1%
if -2.49999999999999992e89 < (*.f64 x y) < 1e51Initial program 99.9%
associate--l+100.0%
associate-/l*99.8%
div-inv99.9%
fma-neg99.9%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
associate-/l*99.9%
associate-/r/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
metadata-eval100.0%
frac-2neg100.0%
div-inv100.0%
associate-*l*100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 67.9%
*-commutative67.9%
*-commutative67.9%
associate-*r*67.9%
*-commutative67.9%
Simplified67.9%
Final simplification72.4%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* x y) -5e+126) (- (* x y) (* (* a b) 0.25)) (if (<= (* x y) 6.2e+51) (+ c (* z (* t 0.0625))) (+ c (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -5e+126) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((x * y) <= 6.2e+51) {
tmp = c + (z * (t * 0.0625));
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if ((x * y) <= (-5d+126)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((x * y) <= 6.2d+51) then
tmp = c + (z * (t * 0.0625d0))
else
tmp = c + (x * y)
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 tmp;
if ((x * y) <= -5e+126) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((x * y) <= 6.2e+51) {
tmp = c + (z * (t * 0.0625));
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -5e+126: tmp = (x * y) - ((a * b) * 0.25) elif (x * y) <= 6.2e+51: tmp = c + (z * (t * 0.0625)) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -5e+126) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(x * y) <= 6.2e+51) tmp = Float64(c + Float64(z * Float64(t * 0.0625))); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -5e+126) tmp = (x * y) - ((a * b) * 0.25); elseif ((x * y) <= 6.2e+51) tmp = c + (z * (t * 0.0625)); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+126], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.2e+51], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+126}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;x \cdot y \leq 6.2 \cdot 10^{+51}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999977e126Initial program 93.7%
Taylor expanded in z around 0 88.1%
Taylor expanded in c around 0 88.1%
if -4.99999999999999977e126 < (*.f64 x y) < 6.20000000000000022e51Initial program 100.0%
associate--l+100.0%
associate-/l*99.8%
div-inv99.9%
fma-neg99.9%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
associate-/l*99.9%
associate-/r/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
metadata-eval100.0%
frac-2neg100.0%
div-inv100.0%
associate-*l*100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 67.4%
*-commutative67.4%
*-commutative67.4%
associate-*r*67.4%
*-commutative67.4%
Simplified67.4%
if 6.20000000000000022e51 < (*.f64 x y) Initial program 95.4%
associate--l+95.4%
associate-/l*95.4%
div-inv95.4%
fma-neg96.9%
clear-num96.9%
div-inv96.9%
metadata-eval96.9%
associate-/l*96.9%
associate-/r/96.9%
distribute-lft-neg-in96.9%
distribute-frac-neg96.9%
metadata-eval96.9%
frac-2neg96.9%
div-inv96.9%
associate-*l*96.9%
metadata-eval96.9%
Applied egg-rr96.9%
Taylor expanded in x around inf 78.0%
Final simplification72.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1.5e+131) (not (<= (* a b) 2.6e+103))) (* -0.25 (* a b)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1.5e+131) || !((a * b) <= 2.6e+103)) {
tmp = -0.25 * (a * b);
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((a * b) <= (-1.5d+131)) .or. (.not. ((a * b) <= 2.6d+103))) then
tmp = (-0.25d0) * (a * b)
else
tmp = 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 tmp;
if (((a * b) <= -1.5e+131) || !((a * b) <= 2.6e+103)) {
tmp = -0.25 * (a * b);
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -1.5e+131) or not ((a * b) <= 2.6e+103): tmp = -0.25 * (a * b) else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -1.5e+131) || !(Float64(a * b) <= 2.6e+103)) tmp = Float64(-0.25 * Float64(a * b)); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -1.5e+131) || ~(((a * b) <= 2.6e+103))) tmp = -0.25 * (a * b); else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.5e+131], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.6e+103]], $MachinePrecision]], N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.5 \cdot 10^{+131} \lor \neg \left(a \cdot b \leq 2.6 \cdot 10^{+103}\right):\\
\;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 a b) < -1.5000000000000001e131 or 2.6000000000000002e103 < (*.f64 a b) Initial program 97.0%
Taylor expanded in x around 0 84.6%
Taylor expanded in a around inf 65.2%
*-commutative65.2%
Simplified65.2%
if -1.5000000000000001e131 < (*.f64 a b) < 2.6000000000000002e103Initial program 98.4%
Taylor expanded in c around inf 24.0%
Final simplification34.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -7e+162) (not (<= (* a b) 7.2e+213))) (* -0.25 (* a b)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -7e+162) || !((a * b) <= 7.2e+213)) {
tmp = -0.25 * (a * b);
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((a * b) <= (-7d+162)) .or. (.not. ((a * b) <= 7.2d+213))) then
tmp = (-0.25d0) * (a * b)
else
tmp = c + (x * y)
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 tmp;
if (((a * b) <= -7e+162) || !((a * b) <= 7.2e+213)) {
tmp = -0.25 * (a * b);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -7e+162) or not ((a * b) <= 7.2e+213): tmp = -0.25 * (a * b) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -7e+162) || !(Float64(a * b) <= 7.2e+213)) tmp = Float64(-0.25 * Float64(a * b)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -7e+162) || ~(((a * b) <= 7.2e+213))) tmp = -0.25 * (a * b); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -7e+162], N[Not[LessEqual[N[(a * b), $MachinePrecision], 7.2e+213]], $MachinePrecision]], N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -7 \cdot 10^{+162} \lor \neg \left(a \cdot b \leq 7.2 \cdot 10^{+213}\right):\\
\;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -7.00000000000000036e162 or 7.2000000000000002e213 < (*.f64 a b) Initial program 95.6%
Taylor expanded in x around 0 89.2%
Taylor expanded in a around inf 83.2%
*-commutative83.2%
Simplified83.2%
if -7.00000000000000036e162 < (*.f64 a b) < 7.2000000000000002e213Initial program 98.5%
associate--l+98.5%
associate-/l*98.4%
div-inv98.5%
fma-neg98.5%
clear-num98.5%
div-inv98.5%
metadata-eval98.5%
associate-/l*98.5%
associate-/r/98.5%
distribute-lft-neg-in98.5%
distribute-frac-neg98.5%
metadata-eval98.5%
frac-2neg98.5%
div-inv98.5%
associate-*l*98.5%
metadata-eval98.5%
Applied egg-rr98.5%
Taylor expanded in x around inf 58.4%
Final simplification62.8%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
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
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 98.0%
Taylor expanded in c around inf 20.3%
Final simplification20.3%
herbie shell --seed 2024011
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))