
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma y 5.0 (* x (fma (+ y z) 2.0 t))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * fma((y + z), 2.0, t)));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * fma(Float64(y + z), 2.0, t))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(y + z), $MachinePrecision] * 2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \mathsf{fma}\left(y + z, 2, t\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in97.2%
associate-+l+97.2%
+-commutative97.2%
count-297.2%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (fma x (+ t (* (+ y z) 2.0)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, (t + ((y + z) * 2.0)), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(t + Float64(Float64(y + z) * 2.0)), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, t + \left(y + z\right) \cdot 2, y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* 2.0 (* x z)))) (t_2 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -2.15e-13)
t_2
(if (<= x 1.9e-212)
t_1
(if (<= x 1.9e-79)
(+ (* y 5.0) (* x t))
(if (<= x 7.5e-31) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (2.0 * (x * z));
double t_2 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -2.15e-13) {
tmp = t_2;
} else if (x <= 1.9e-212) {
tmp = t_1;
} else if (x <= 1.9e-79) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 7.5e-31) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * 5.0d0) + (2.0d0 * (x * z))
t_2 = x * (t + ((y + z) * 2.0d0))
if (x <= (-2.15d-13)) then
tmp = t_2
else if (x <= 1.9d-212) then
tmp = t_1
else if (x <= 1.9d-79) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 7.5d-31) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (2.0 * (x * z));
double t_2 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -2.15e-13) {
tmp = t_2;
} else if (x <= 1.9e-212) {
tmp = t_1;
} else if (x <= 1.9e-79) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 7.5e-31) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (2.0 * (x * z)) t_2 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -2.15e-13: tmp = t_2 elif x <= 1.9e-212: tmp = t_1 elif x <= 1.9e-79: tmp = (y * 5.0) + (x * t) elif x <= 7.5e-31: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))) t_2 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -2.15e-13) tmp = t_2; elseif (x <= 1.9e-212) tmp = t_1; elseif (x <= 1.9e-79) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 7.5e-31) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * 5.0) + (2.0 * (x * z)); t_2 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -2.15e-13) tmp = t_2; elseif (x <= 1.9e-212) tmp = t_1; elseif (x <= 1.9e-79) tmp = (y * 5.0) + (x * t); elseif (x <= 7.5e-31) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.15e-13], t$95$2, If[LessEqual[x, 1.9e-212], t$95$1, If[LessEqual[x, 1.9e-79], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e-31], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{-13}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-212}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-79}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-31}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.1499999999999999e-13 or 7.49999999999999975e-31 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.2%
if -2.1499999999999999e-13 < x < 1.90000000000000011e-212 or 1.9000000000000001e-79 < x < 7.49999999999999975e-31Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 85.9%
Taylor expanded in y around 0 85.9%
if 1.90000000000000011e-212 < x < 1.9000000000000001e-79Initial program 99.9%
distribute-rgt-in99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
*-commutative99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 81.2%
Simplified81.2%
Final simplification92.6%
(FPCore (x y z t)
:precision binary64
(if (<= t -1e+170)
(+ (* y 5.0) (* x t))
(if (or (<= t -290.0) (not (<= t 9.5e+41)))
(* x (+ t (* (+ y z) 2.0)))
(+ (* y 5.0) (* 2.0 (* x (+ y z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1e+170) {
tmp = (y * 5.0) + (x * t);
} else if ((t <= -290.0) || !(t <= 9.5e+41)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d+170)) then
tmp = (y * 5.0d0) + (x * t)
else if ((t <= (-290.0d0)) .or. (.not. (t <= 9.5d+41))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (2.0d0 * (x * (y + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1e+170) {
tmp = (y * 5.0) + (x * t);
} else if ((t <= -290.0) || !(t <= 9.5e+41)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1e+170: tmp = (y * 5.0) + (x * t) elif (t <= -290.0) or not (t <= 9.5e+41): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (2.0 * (x * (y + z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1e+170) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif ((t <= -290.0) || !(t <= 9.5e+41)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * Float64(y + z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1e+170) tmp = (y * 5.0) + (x * t); elseif ((t <= -290.0) || ~((t <= 9.5e+41))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (2.0 * (x * (y + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1e+170], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -290.0], N[Not[LessEqual[t, 9.5e+41]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+170}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;t \leq -290 \lor \neg \left(t \leq 9.5 \cdot 10^{+41}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\end{array}
\end{array}
if t < -1.00000000000000003e170Initial program 100.0%
distribute-rgt-in86.2%
fma-def93.1%
associate-+l+93.1%
+-commutative93.1%
count-293.1%
*-commutative93.1%
*-commutative93.1%
Applied egg-rr93.1%
Taylor expanded in t around inf 89.7%
Simplified89.7%
if -1.00000000000000003e170 < t < -290 or 9.4999999999999996e41 < t Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 86.4%
if -290 < t < 9.4999999999999996e41Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 97.8%
Final simplification92.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.4e+23) (not (<= x 2.5e-10))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (+ (* 2.0 (* x z)) (* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.4e+23) || !(x <= 2.5e-10)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + ((2.0 * (x * z)) + (x * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.4d+23)) .or. (.not. (x <= 2.5d-10))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + ((2.0d0 * (x * z)) + (x * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.4e+23) || !(x <= 2.5e-10)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + ((2.0 * (x * z)) + (x * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.4e+23) or not (x <= 2.5e-10): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + ((2.0 * (x * z)) + (x * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.4e+23) || !(x <= 2.5e-10)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(Float64(2.0 * Float64(x * z)) + Float64(x * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.4e+23) || ~((x <= 2.5e-10))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + ((2.0 * (x * z)) + (x * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.4e+23], N[Not[LessEqual[x, 2.5e-10]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+23} \lor \neg \left(x \leq 2.5 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + \left(2 \cdot \left(x \cdot z\right) + x \cdot t\right)\\
\end{array}
\end{array}
if x < -2.4e23 or 2.50000000000000016e-10 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -2.4e23 < x < 2.50000000000000016e-10Initial program 99.9%
distribute-rgt-in99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
*-commutative99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 99.7%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= z -2e+83)
t_1
(if (<= z -0.046)
(* y 5.0)
(if (<= z -2.4e-260)
(* x t)
(if (<= z 9.5e-212)
(* x (* y 2.0))
(if (<= z 5.8e+74) (* x t) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (z <= -2e+83) {
tmp = t_1;
} else if (z <= -0.046) {
tmp = y * 5.0;
} else if (z <= -2.4e-260) {
tmp = x * t;
} else if (z <= 9.5e-212) {
tmp = x * (y * 2.0);
} else if (z <= 5.8e+74) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (z <= (-2d+83)) then
tmp = t_1
else if (z <= (-0.046d0)) then
tmp = y * 5.0d0
else if (z <= (-2.4d-260)) then
tmp = x * t
else if (z <= 9.5d-212) then
tmp = x * (y * 2.0d0)
else if (z <= 5.8d+74) then
tmp = x * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (z <= -2e+83) {
tmp = t_1;
} else if (z <= -0.046) {
tmp = y * 5.0;
} else if (z <= -2.4e-260) {
tmp = x * t;
} else if (z <= 9.5e-212) {
tmp = x * (y * 2.0);
} else if (z <= 5.8e+74) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if z <= -2e+83: tmp = t_1 elif z <= -0.046: tmp = y * 5.0 elif z <= -2.4e-260: tmp = x * t elif z <= 9.5e-212: tmp = x * (y * 2.0) elif z <= 5.8e+74: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (z <= -2e+83) tmp = t_1; elseif (z <= -0.046) tmp = Float64(y * 5.0); elseif (z <= -2.4e-260) tmp = Float64(x * t); elseif (z <= 9.5e-212) tmp = Float64(x * Float64(y * 2.0)); elseif (z <= 5.8e+74) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (z <= -2e+83) tmp = t_1; elseif (z <= -0.046) tmp = y * 5.0; elseif (z <= -2.4e-260) tmp = x * t; elseif (z <= 9.5e-212) tmp = x * (y * 2.0); elseif (z <= 5.8e+74) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+83], t$95$1, If[LessEqual[z, -0.046], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, -2.4e-260], N[(x * t), $MachinePrecision], If[LessEqual[z, 9.5e-212], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+74], N[(x * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -0.046:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-260}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-212}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+74}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.00000000000000006e83 or 5.8000000000000005e74 < z Initial program 99.9%
Taylor expanded in z around inf 75.1%
if -2.00000000000000006e83 < z < -0.045999999999999999Initial program 100.0%
Taylor expanded in x around 0 65.4%
if -0.045999999999999999 < z < -2.4000000000000001e-260 or 9.50000000000000029e-212 < z < 5.8000000000000005e74Initial program 99.9%
Taylor expanded in t around inf 50.0%
if -2.4000000000000001e-260 < z < 9.50000000000000029e-212Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 66.7%
Taylor expanded in z around 0 66.7%
Taylor expanded in t around 0 47.7%
*-commutative47.7%
associate-*r*47.7%
*-commutative47.7%
Simplified47.7%
Final simplification60.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.86e+84) (not (<= z 1.8e+75))) (+ (* y 5.0) (* 2.0 (* x z))) (+ (* x t) (* y (+ 5.0 (* x 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.86e+84) || !(z <= 1.8e+75)) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = (x * t) + (y * (5.0 + (x * 2.0)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.86d+84)) .or. (.not. (z <= 1.8d+75))) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
else
tmp = (x * t) + (y * (5.0d0 + (x * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.86e+84) || !(z <= 1.8e+75)) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = (x * t) + (y * (5.0 + (x * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.86e+84) or not (z <= 1.8e+75): tmp = (y * 5.0) + (2.0 * (x * z)) else: tmp = (x * t) + (y * (5.0 + (x * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.86e+84) || !(z <= 1.8e+75)) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); else tmp = Float64(Float64(x * t) + Float64(y * Float64(5.0 + Float64(x * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.86e+84) || ~((z <= 1.8e+75))) tmp = (y * 5.0) + (2.0 * (x * z)); else tmp = (x * t) + (y * (5.0 + (x * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.86e+84], N[Not[LessEqual[z, 1.8e+75]], $MachinePrecision]], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * t), $MachinePrecision] + N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.86 \cdot 10^{+84} \lor \neg \left(z \leq 1.8 \cdot 10^{+75}\right):\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t + y \cdot \left(5 + x \cdot 2\right)\\
\end{array}
\end{array}
if z < -1.86000000000000006e84 or 1.8e75 < z Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 92.0%
Taylor expanded in y around 0 92.1%
if -1.86000000000000006e84 < z < 1.8e75Initial program 99.9%
Taylor expanded in y around inf 94.3%
Taylor expanded in y around 0 93.0%
Final simplification92.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.1e+85) (not (<= z 3.6e+75))) (+ (* y 5.0) (* 2.0 (* x z))) (+ (* y 5.0) (* x (+ t (+ y y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.1e+85) || !(z <= 3.6e+75)) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = (y * 5.0) + (x * (t + (y + y)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.1d+85)) .or. (.not. (z <= 3.6d+75))) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
else
tmp = (y * 5.0d0) + (x * (t + (y + y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.1e+85) || !(z <= 3.6e+75)) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = (y * 5.0) + (x * (t + (y + y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.1e+85) or not (z <= 3.6e+75): tmp = (y * 5.0) + (2.0 * (x * z)) else: tmp = (y * 5.0) + (x * (t + (y + y))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.1e+85) || !(z <= 3.6e+75)) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.1e+85) || ~((z <= 3.6e+75))) tmp = (y * 5.0) + (2.0 * (x * z)); else tmp = (y * 5.0) + (x * (t + (y + y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.1e+85], N[Not[LessEqual[z, 3.6e+75]], $MachinePrecision]], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+85} \lor \neg \left(z \leq 3.6 \cdot 10^{+75}\right):\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\end{array}
\end{array}
if z < -2.1000000000000001e85 or 3.6e75 < z Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 92.0%
Taylor expanded in y around 0 92.1%
if -2.1000000000000001e85 < z < 3.6e75Initial program 99.9%
Taylor expanded in y around inf 94.3%
Final simplification93.4%
(FPCore (x y z t) :precision binary64 (+ (* y 5.0) (* x (+ t (+ y (+ z (+ y z)))))))
double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * 5.0d0) + (x * (t + (y + (z + (y + z)))))
end function
public static double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
def code(x, y, z, t): return (y * 5.0) + (x * (t + (y + (z + (y + z)))))
function code(x, y, z, t) return Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z)))))) end
function tmp = code(x, y, z, t) tmp = (y * 5.0) + (x * (t + (y + (z + (y + z))))); end
code[x_, y_, z_, t_] := N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.8e-75) (not (<= x 1.3e-83))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e-75) || !(x <= 1.3e-83)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.8d-75)) .or. (.not. (x <= 1.3d-83))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (x * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e-75) || !(x <= 1.3e-83)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.8e-75) or not (x <= 1.3e-83): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.8e-75) || !(x <= 1.3e-83)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.8e-75) || ~((x <= 1.3e-83))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.8e-75], N[Not[LessEqual[x, 1.3e-83]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-75} \lor \neg \left(x \leq 1.3 \cdot 10^{-83}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -2.79999999999999998e-75 or 1.30000000000000004e-83 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 94.3%
if -2.79999999999999998e-75 < x < 1.30000000000000004e-83Initial program 99.9%
distribute-rgt-in99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
*-commutative99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 81.6%
Simplified81.6%
Final simplification89.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= z -1.35e+83)
t_1
(if (<= z -2.85e+17) (* y 5.0) (if (<= z 1.6e+75) (* x t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (z <= -1.35e+83) {
tmp = t_1;
} else if (z <= -2.85e+17) {
tmp = y * 5.0;
} else if (z <= 1.6e+75) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (z <= (-1.35d+83)) then
tmp = t_1
else if (z <= (-2.85d+17)) then
tmp = y * 5.0d0
else if (z <= 1.6d+75) then
tmp = x * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (z <= -1.35e+83) {
tmp = t_1;
} else if (z <= -2.85e+17) {
tmp = y * 5.0;
} else if (z <= 1.6e+75) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if z <= -1.35e+83: tmp = t_1 elif z <= -2.85e+17: tmp = y * 5.0 elif z <= 1.6e+75: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (z <= -1.35e+83) tmp = t_1; elseif (z <= -2.85e+17) tmp = Float64(y * 5.0); elseif (z <= 1.6e+75) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (z <= -1.35e+83) tmp = t_1; elseif (z <= -2.85e+17) tmp = y * 5.0; elseif (z <= 1.6e+75) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+83], t$95$1, If[LessEqual[z, -2.85e+17], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 1.6e+75], N[(x * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.85 \cdot 10^{+17}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+75}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.35000000000000003e83 or 1.59999999999999992e75 < z Initial program 99.9%
Taylor expanded in z around inf 75.1%
if -1.35000000000000003e83 < z < -2.85e17Initial program 100.0%
Taylor expanded in x around 0 65.4%
if -2.85e17 < z < 1.59999999999999992e75Initial program 99.9%
Taylor expanded in t around inf 44.7%
Final simplification58.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.38e+84) (not (<= z 5.5e+74))) (* 2.0 (* x z)) (* x (+ t (* y 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.38e+84) || !(z <= 5.5e+74)) {
tmp = 2.0 * (x * z);
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.38d+84)) .or. (.not. (z <= 5.5d+74))) then
tmp = 2.0d0 * (x * z)
else
tmp = x * (t + (y * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.38e+84) || !(z <= 5.5e+74)) {
tmp = 2.0 * (x * z);
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.38e+84) or not (z <= 5.5e+74): tmp = 2.0 * (x * z) else: tmp = x * (t + (y * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.38e+84) || !(z <= 5.5e+74)) tmp = Float64(2.0 * Float64(x * z)); else tmp = Float64(x * Float64(t + Float64(y * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.38e+84) || ~((z <= 5.5e+74))) tmp = 2.0 * (x * z); else tmp = x * (t + (y * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.38e+84], N[Not[LessEqual[z, 5.5e+74]], $MachinePrecision]], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.38 \cdot 10^{+84} \lor \neg \left(z \leq 5.5 \cdot 10^{+74}\right):\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if z < -1.38e84 or 5.5000000000000003e74 < z Initial program 99.9%
Taylor expanded in z around inf 75.8%
if -1.38e84 < z < 5.5000000000000003e74Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 68.6%
Taylor expanded in z around 0 62.9%
Final simplification68.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.55e+80) (not (<= z 1.34e+20))) (* x (+ t (* z 2.0))) (* x (+ t (* y 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.55e+80) || !(z <= 1.34e+20)) {
tmp = x * (t + (z * 2.0));
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.55d+80)) .or. (.not. (z <= 1.34d+20))) then
tmp = x * (t + (z * 2.0d0))
else
tmp = x * (t + (y * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.55e+80) || !(z <= 1.34e+20)) {
tmp = x * (t + (z * 2.0));
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.55e+80) or not (z <= 1.34e+20): tmp = x * (t + (z * 2.0)) else: tmp = x * (t + (y * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.55e+80) || !(z <= 1.34e+20)) tmp = Float64(x * Float64(t + Float64(z * 2.0))); else tmp = Float64(x * Float64(t + Float64(y * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.55e+80) || ~((z <= 1.34e+20))) tmp = x * (t + (z * 2.0)); else tmp = x * (t + (y * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.55e+80], N[Not[LessEqual[z, 1.34e+20]], $MachinePrecision]], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.55 \cdot 10^{+80} \lor \neg \left(z \leq 1.34 \cdot 10^{+20}\right):\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if z < -3.54999999999999994e80 or 1.34e20 < z Initial program 99.9%
Taylor expanded in y around 0 79.2%
if -3.54999999999999994e80 < z < 1.34e20Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 67.8%
Taylor expanded in z around 0 63.5%
Final simplification70.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -15500000000000.0) (not (<= y 3e+64))) (* y (+ 5.0 (* x 2.0))) (* x (+ t (* z 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -15500000000000.0) || !(y <= 3e+64)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-15500000000000.0d0)) .or. (.not. (y <= 3d+64))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -15500000000000.0) || !(y <= 3e+64)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -15500000000000.0) or not (y <= 3e+64): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -15500000000000.0) || !(y <= 3e+64)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -15500000000000.0) || ~((y <= 3e+64))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -15500000000000.0], N[Not[LessEqual[y, 3e+64]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -15500000000000 \lor \neg \left(y \leq 3 \cdot 10^{+64}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -1.55e13 or 3.0000000000000002e64 < y Initial program 99.9%
Taylor expanded in y around inf 73.0%
Simplified73.0%
if -1.55e13 < y < 3.0000000000000002e64Initial program 99.9%
Taylor expanded in y around 0 82.2%
Final simplification78.4%
(FPCore (x y z t) :precision binary64 (if (<= t -8.5e-5) (* x t) (if (<= t 1e+41) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.5e-5) {
tmp = x * t;
} else if (t <= 1e+41) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-8.5d-5)) then
tmp = x * t
else if (t <= 1d+41) then
tmp = y * 5.0d0
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.5e-5) {
tmp = x * t;
} else if (t <= 1e+41) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -8.5e-5: tmp = x * t elif t <= 1e+41: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -8.5e-5) tmp = Float64(x * t); elseif (t <= 1e+41) tmp = Float64(y * 5.0); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -8.5e-5) tmp = x * t; elseif (t <= 1e+41) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -8.5e-5], N[(x * t), $MachinePrecision], If[LessEqual[t, 1e+41], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-5}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq 10^{+41}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if t < -8.500000000000001e-5 or 1.00000000000000001e41 < t Initial program 99.9%
Taylor expanded in t around inf 59.6%
if -8.500000000000001e-5 < t < 1.00000000000000001e41Initial program 99.9%
Taylor expanded in x around 0 35.1%
Final simplification46.5%
(FPCore (x y z t) :precision binary64 (* y 5.0))
double code(double x, double y, double z, double t) {
return y * 5.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * 5.0d0
end function
public static double code(double x, double y, double z, double t) {
return y * 5.0;
}
def code(x, y, z, t): return y * 5.0
function code(x, y, z, t) return Float64(y * 5.0) end
function tmp = code(x, y, z, t) tmp = y * 5.0; end
code[x_, y_, z_, t_] := N[(y * 5.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 27.2%
Final simplification27.2%
herbie shell --seed 2023297
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))