
(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 19 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 x (+ (* 2.0 (+ y z)) t) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, ((2.0 * (y + z)) + t), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(Float64(2.0 * Float64(y + z)) + t), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, 2 \cdot \left(y + z\right) + t, y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x (+ y z)))))
(if (<= t -1.32e+100)
(* x t)
(if (<= t -1.5e+29)
t_1
(if (<= t -6e-207)
(* y (+ x 5.0))
(if (<= t 1.7e-199)
t_1
(if (<= t 4.5e-173) (* y 5.0) (if (<= t 3.4e+58) t_1 (* x t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double tmp;
if (t <= -1.32e+100) {
tmp = x * t;
} else if (t <= -1.5e+29) {
tmp = t_1;
} else if (t <= -6e-207) {
tmp = y * (x + 5.0);
} else if (t <= 1.7e-199) {
tmp = t_1;
} else if (t <= 4.5e-173) {
tmp = y * 5.0;
} else if (t <= 3.4e+58) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * (y + z))
if (t <= (-1.32d+100)) then
tmp = x * t
else if (t <= (-1.5d+29)) then
tmp = t_1
else if (t <= (-6d-207)) then
tmp = y * (x + 5.0d0)
else if (t <= 1.7d-199) then
tmp = t_1
else if (t <= 4.5d-173) then
tmp = y * 5.0d0
else if (t <= 3.4d+58) then
tmp = t_1
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double tmp;
if (t <= -1.32e+100) {
tmp = x * t;
} else if (t <= -1.5e+29) {
tmp = t_1;
} else if (t <= -6e-207) {
tmp = y * (x + 5.0);
} else if (t <= 1.7e-199) {
tmp = t_1;
} else if (t <= 4.5e-173) {
tmp = y * 5.0;
} else if (t <= 3.4e+58) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * (y + z)) tmp = 0 if t <= -1.32e+100: tmp = x * t elif t <= -1.5e+29: tmp = t_1 elif t <= -6e-207: tmp = y * (x + 5.0) elif t <= 1.7e-199: tmp = t_1 elif t <= 4.5e-173: tmp = y * 5.0 elif t <= 3.4e+58: tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * Float64(y + z))) tmp = 0.0 if (t <= -1.32e+100) tmp = Float64(x * t); elseif (t <= -1.5e+29) tmp = t_1; elseif (t <= -6e-207) tmp = Float64(y * Float64(x + 5.0)); elseif (t <= 1.7e-199) tmp = t_1; elseif (t <= 4.5e-173) tmp = Float64(y * 5.0); elseif (t <= 3.4e+58) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * (y + z)); tmp = 0.0; if (t <= -1.32e+100) tmp = x * t; elseif (t <= -1.5e+29) tmp = t_1; elseif (t <= -6e-207) tmp = y * (x + 5.0); elseif (t <= 1.7e-199) tmp = t_1; elseif (t <= 4.5e-173) tmp = y * 5.0; elseif (t <= 3.4e+58) tmp = t_1; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.32e+100], N[(x * t), $MachinePrecision], If[LessEqual[t, -1.5e+29], t$95$1, If[LessEqual[t, -6e-207], N[(y * N[(x + 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e-199], t$95$1, If[LessEqual[t, 4.5e-173], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 3.4e+58], t$95$1, N[(x * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{if}\;t \leq -1.32 \cdot 10^{+100}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6 \cdot 10^{-207}:\\
\;\;\;\;y \cdot \left(x + 5\right)\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-173}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if t < -1.32e100 or 3.4000000000000001e58 < t Initial program 100.0%
Taylor expanded in t around inf 69.1%
Simplified69.1%
if -1.32e100 < t < -1.5e29 or -5.9999999999999999e-207 < t < 1.70000000000000003e-199 or 4.50000000000000018e-173 < t < 3.4000000000000001e58Initial program 99.9%
Taylor expanded in y around 0 97.9%
Taylor expanded in x around inf 74.0%
Simplified74.0%
Taylor expanded in t around 0 66.8%
*-commutative66.8%
*-commutative66.8%
associate-*r*66.8%
*-commutative66.8%
associate-*r*66.8%
*-commutative66.8%
distribute-lft-out67.9%
associate-*r*67.9%
distribute-lft-out67.9%
*-commutative67.9%
distribute-lft-out67.9%
associate-*l*67.9%
Simplified67.9%
if -1.5e29 < t < -5.9999999999999999e-207Initial program 100.0%
Taylor expanded in y around 0 93.4%
Taylor expanded in y around inf 70.4%
if 1.70000000000000003e-199 < t < 4.50000000000000018e-173Initial program 99.8%
Taylor expanded in x around 0 78.0%
Final simplification69.2%
(FPCore (x y z t)
:precision binary64
(if (<= t -5.2e+39)
(* x t)
(if (<= t 1e-301)
(* y 5.0)
(if (<= t 1.15e-259)
(* y (* x 2.0))
(if (<= t 1.15e-140)
(* y 5.0)
(if (<= t 4.7e+57) (* 2.0 (* x z)) (* x t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.2e+39) {
tmp = x * t;
} else if (t <= 1e-301) {
tmp = y * 5.0;
} else if (t <= 1.15e-259) {
tmp = y * (x * 2.0);
} else if (t <= 1.15e-140) {
tmp = y * 5.0;
} else if (t <= 4.7e+57) {
tmp = 2.0 * (x * z);
} 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 <= (-5.2d+39)) then
tmp = x * t
else if (t <= 1d-301) then
tmp = y * 5.0d0
else if (t <= 1.15d-259) then
tmp = y * (x * 2.0d0)
else if (t <= 1.15d-140) then
tmp = y * 5.0d0
else if (t <= 4.7d+57) then
tmp = 2.0d0 * (x * z)
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 <= -5.2e+39) {
tmp = x * t;
} else if (t <= 1e-301) {
tmp = y * 5.0;
} else if (t <= 1.15e-259) {
tmp = y * (x * 2.0);
} else if (t <= 1.15e-140) {
tmp = y * 5.0;
} else if (t <= 4.7e+57) {
tmp = 2.0 * (x * z);
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.2e+39: tmp = x * t elif t <= 1e-301: tmp = y * 5.0 elif t <= 1.15e-259: tmp = y * (x * 2.0) elif t <= 1.15e-140: tmp = y * 5.0 elif t <= 4.7e+57: tmp = 2.0 * (x * z) else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.2e+39) tmp = Float64(x * t); elseif (t <= 1e-301) tmp = Float64(y * 5.0); elseif (t <= 1.15e-259) tmp = Float64(y * Float64(x * 2.0)); elseif (t <= 1.15e-140) tmp = Float64(y * 5.0); elseif (t <= 4.7e+57) tmp = Float64(2.0 * Float64(x * z)); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.2e+39) tmp = x * t; elseif (t <= 1e-301) tmp = y * 5.0; elseif (t <= 1.15e-259) tmp = y * (x * 2.0); elseif (t <= 1.15e-140) tmp = y * 5.0; elseif (t <= 4.7e+57) tmp = 2.0 * (x * z); else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.2e+39], N[(x * t), $MachinePrecision], If[LessEqual[t, 1e-301], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 1.15e-259], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-140], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 4.7e+57], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+39}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq 10^{-301}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-259}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-140}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq 4.7 \cdot 10^{+57}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if t < -5.2e39 or 4.7000000000000003e57 < t Initial program 99.9%
Taylor expanded in t around inf 65.8%
Simplified65.8%
if -5.2e39 < t < 1.00000000000000007e-301 or 1.15e-259 < t < 1.1500000000000001e-140Initial program 99.9%
Taylor expanded in x around 0 47.3%
if 1.00000000000000007e-301 < t < 1.15e-259Initial program 100.0%
Taylor expanded in y around inf 82.4%
Simplified82.4%
Taylor expanded in x around inf 64.9%
*-commutative64.9%
*-commutative64.9%
associate-*r*64.9%
Simplified64.9%
if 1.1500000000000001e-140 < t < 4.7000000000000003e57Initial program 100.0%
Taylor expanded in z around inf 50.9%
Final simplification57.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.65e-9) (not (<= x 2.4e-23))) (* x (+ t (+ (* 2.0 (+ y z)) (* 5.0 (/ y x))))) (+ (* y 5.0) (* x (+ t (+ y (* 2.0 z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.65e-9) || !(x <= 2.4e-23)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (y * 5.0) + (x * (t + (y + (2.0 * 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 ((x <= (-1.65d-9)) .or. (.not. (x <= 2.4d-23))) then
tmp = x * (t + ((2.0d0 * (y + z)) + (5.0d0 * (y / x))))
else
tmp = (y * 5.0d0) + (x * (t + (y + (2.0d0 * z))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.65e-9) || !(x <= 2.4e-23)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (y * 5.0) + (x * (t + (y + (2.0 * z))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.65e-9) or not (x <= 2.4e-23): tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))) else: tmp = (y * 5.0) + (x * (t + (y + (2.0 * z)))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.65e-9) || !(x <= 2.4e-23)) tmp = Float64(x * Float64(t + Float64(Float64(2.0 * Float64(y + z)) + Float64(5.0 * Float64(y / x))))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(2.0 * z))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.65e-9) || ~((x <= 2.4e-23))) tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))); else tmp = (y * 5.0) + (x * (t + (y + (2.0 * z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.65e-9], N[Not[LessEqual[x, 2.4e-23]], $MachinePrecision]], N[(x * N[(t + N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-9} \lor \neg \left(x \leq 2.4 \cdot 10^{-23}\right):\\
\;\;\;\;x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + 2 \cdot z\right)\right)\\
\end{array}
\end{array}
if x < -1.65000000000000009e-9 or 2.39999999999999996e-23 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.9%
if -1.65000000000000009e-9 < x < 2.39999999999999996e-23Initial program 99.9%
Taylor expanded in y around 0 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -34000000000000.0) (not (<= x 6.2e-6))) (* x (+ (* 2.0 (+ y z)) t)) (+ (* y 5.0) (* x (+ t (+ y (* 2.0 z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -34000000000000.0) || !(x <= 6.2e-6)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (y * 5.0) + (x * (t + (y + (2.0 * 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 ((x <= (-34000000000000.0d0)) .or. (.not. (x <= 6.2d-6))) then
tmp = x * ((2.0d0 * (y + z)) + t)
else
tmp = (y * 5.0d0) + (x * (t + (y + (2.0d0 * z))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -34000000000000.0) || !(x <= 6.2e-6)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (y * 5.0) + (x * (t + (y + (2.0 * z))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -34000000000000.0) or not (x <= 6.2e-6): tmp = x * ((2.0 * (y + z)) + t) else: tmp = (y * 5.0) + (x * (t + (y + (2.0 * z)))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -34000000000000.0) || !(x <= 6.2e-6)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(2.0 * z))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -34000000000000.0) || ~((x <= 6.2e-6))) tmp = x * ((2.0 * (y + z)) + t); else tmp = (y * 5.0) + (x * (t + (y + (2.0 * z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -34000000000000.0], N[Not[LessEqual[x, 6.2e-6]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -34000000000000 \lor \neg \left(x \leq 6.2 \cdot 10^{-6}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + 2 \cdot z\right)\right)\\
\end{array}
\end{array}
if x < -3.4e13 or 6.1999999999999999e-6 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.1%
if -3.4e13 < x < 6.1999999999999999e-6Initial program 99.9%
Taylor expanded in y around 0 99.1%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -8.5e+27)
t_1
(if (<= y 7600000.0)
(* x (+ t (* 2.0 z)))
(if (<= y 3.1e+122) (+ (* y 5.0) (* x t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -8.5e+27) {
tmp = t_1;
} else if (y <= 7600000.0) {
tmp = x * (t + (2.0 * z));
} else if (y <= 3.1e+122) {
tmp = (y * 5.0) + (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 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-8.5d+27)) then
tmp = t_1
else if (y <= 7600000.0d0) then
tmp = x * (t + (2.0d0 * z))
else if (y <= 3.1d+122) then
tmp = (y * 5.0d0) + (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 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -8.5e+27) {
tmp = t_1;
} else if (y <= 7600000.0) {
tmp = x * (t + (2.0 * z));
} else if (y <= 3.1e+122) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -8.5e+27: tmp = t_1 elif y <= 7600000.0: tmp = x * (t + (2.0 * z)) elif y <= 3.1e+122: tmp = (y * 5.0) + (x * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -8.5e+27) tmp = t_1; elseif (y <= 7600000.0) tmp = Float64(x * Float64(t + Float64(2.0 * z))); elseif (y <= 3.1e+122) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -8.5e+27) tmp = t_1; elseif (y <= 7600000.0) tmp = x * (t + (2.0 * z)); elseif (y <= 3.1e+122) tmp = (y * 5.0) + (x * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.5e+27], t$95$1, If[LessEqual[y, 7600000.0], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e+122], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7600000:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+122}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.5e27 or 3.09999999999999999e122 < y Initial program 99.9%
Taylor expanded in y around inf 87.1%
Simplified87.1%
if -8.5e27 < y < 7.6e6Initial program 100.0%
Taylor expanded in y around 0 83.0%
if 7.6e6 < y < 3.09999999999999999e122Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 84.2%
Taylor expanded in x around 0 66.0%
Taylor expanded in x around 0 81.6%
Final simplification84.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.4e-81) (not (<= y 4200000.0))) (+ (* y (+ 5.0 (* x 2.0))) (* x t)) (* x (+ (* 2.0 (+ y z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.4e-81) || !(y <= 4200000.0)) {
tmp = (y * (5.0 + (x * 2.0))) + (x * t);
} else {
tmp = x * ((2.0 * (y + z)) + 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 ((y <= (-3.4d-81)) .or. (.not. (y <= 4200000.0d0))) then
tmp = (y * (5.0d0 + (x * 2.0d0))) + (x * t)
else
tmp = x * ((2.0d0 * (y + z)) + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.4e-81) || !(y <= 4200000.0)) {
tmp = (y * (5.0 + (x * 2.0))) + (x * t);
} else {
tmp = x * ((2.0 * (y + z)) + t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.4e-81) or not (y <= 4200000.0): tmp = (y * (5.0 + (x * 2.0))) + (x * t) else: tmp = x * ((2.0 * (y + z)) + t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.4e-81) || !(y <= 4200000.0)) tmp = Float64(Float64(y * Float64(5.0 + Float64(x * 2.0))) + Float64(x * t)); else tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.4e-81) || ~((y <= 4200000.0))) tmp = (y * (5.0 + (x * 2.0))) + (x * t); else tmp = x * ((2.0 * (y + z)) + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.4e-81], N[Not[LessEqual[y, 4200000.0]], $MachinePrecision]], N[(N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-81} \lor \neg \left(y \leq 4200000\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right) + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\end{array}
\end{array}
if y < -3.3999999999999999e-81 or 4.2e6 < y Initial program 99.9%
Taylor expanded in y around 0 95.4%
Taylor expanded in z around 0 90.7%
if -3.3999999999999999e-81 < y < 4.2e6Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 90.8%
Final simplification90.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2e-81) (not (<= y 180000000.0))) (+ (* y 5.0) (* x (+ t (+ y y)))) (* x (+ (* 2.0 (+ y z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2e-81) || !(y <= 180000000.0)) {
tmp = (y * 5.0) + (x * (t + (y + y)));
} else {
tmp = x * ((2.0 * (y + z)) + 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 ((y <= (-2d-81)) .or. (.not. (y <= 180000000.0d0))) then
tmp = (y * 5.0d0) + (x * (t + (y + y)))
else
tmp = x * ((2.0d0 * (y + z)) + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2e-81) || !(y <= 180000000.0)) {
tmp = (y * 5.0) + (x * (t + (y + y)));
} else {
tmp = x * ((2.0 * (y + z)) + t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2e-81) or not (y <= 180000000.0): tmp = (y * 5.0) + (x * (t + (y + y))) else: tmp = x * ((2.0 * (y + z)) + t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2e-81) || !(y <= 180000000.0)) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + y)))); else tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2e-81) || ~((y <= 180000000.0))) tmp = (y * 5.0) + (x * (t + (y + y))); else tmp = x * ((2.0 * (y + z)) + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2e-81], N[Not[LessEqual[y, 180000000.0]], $MachinePrecision]], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-81} \lor \neg \left(y \leq 180000000\right):\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\end{array}
\end{array}
if y < -1.9999999999999999e-81 or 1.8e8 < y Initial program 99.9%
Taylor expanded in y around inf 93.3%
if -1.9999999999999999e-81 < y < 1.8e8Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 90.8%
Final simplification92.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.5e+92) (not (<= t 1.45e+57))) (+ (* y 5.0) (* x (+ t (+ y y)))) (+ (* y 5.0) (* (+ y z) (* x 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.5e+92) || !(t <= 1.45e+57)) {
tmp = (y * 5.0) + (x * (t + (y + y)));
} else {
tmp = (y * 5.0) + ((y + z) * (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 ((t <= (-1.5d+92)) .or. (.not. (t <= 1.45d+57))) then
tmp = (y * 5.0d0) + (x * (t + (y + y)))
else
tmp = (y * 5.0d0) + ((y + z) * (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.5e+92) || !(t <= 1.45e+57)) {
tmp = (y * 5.0) + (x * (t + (y + y)));
} else {
tmp = (y * 5.0) + ((y + z) * (x * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.5e+92) or not (t <= 1.45e+57): tmp = (y * 5.0) + (x * (t + (y + y))) else: tmp = (y * 5.0) + ((y + z) * (x * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.5e+92) || !(t <= 1.45e+57)) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + y)))); else tmp = Float64(Float64(y * 5.0) + Float64(Float64(y + z) * Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.5e+92) || ~((t <= 1.45e+57))) tmp = (y * 5.0) + (x * (t + (y + y))); else tmp = (y * 5.0) + ((y + z) * (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.5e+92], N[Not[LessEqual[t, 1.45e+57]], $MachinePrecision]], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+92} \lor \neg \left(t \leq 1.45 \cdot 10^{+57}\right):\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + \left(y + z\right) \cdot \left(x \cdot 2\right)\\
\end{array}
\end{array}
if t < -1.50000000000000007e92 or 1.4500000000000001e57 < t Initial program 99.9%
Taylor expanded in y around inf 91.9%
if -1.50000000000000007e92 < t < 1.4500000000000001e57Initial program 99.9%
Taylor expanded in t around 0 93.2%
Simplified93.2%
Final simplification92.6%
(FPCore (x y z t) :precision binary64 (if (<= t -2.4e+39) (* x t) (if (<= t 5.2e-145) (* y 5.0) (if (<= t 3.8e+53) (* 2.0 (* x z)) (* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.4e+39) {
tmp = x * t;
} else if (t <= 5.2e-145) {
tmp = y * 5.0;
} else if (t <= 3.8e+53) {
tmp = 2.0 * (x * z);
} 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 <= (-2.4d+39)) then
tmp = x * t
else if (t <= 5.2d-145) then
tmp = y * 5.0d0
else if (t <= 3.8d+53) then
tmp = 2.0d0 * (x * z)
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 <= -2.4e+39) {
tmp = x * t;
} else if (t <= 5.2e-145) {
tmp = y * 5.0;
} else if (t <= 3.8e+53) {
tmp = 2.0 * (x * z);
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.4e+39: tmp = x * t elif t <= 5.2e-145: tmp = y * 5.0 elif t <= 3.8e+53: tmp = 2.0 * (x * z) else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.4e+39) tmp = Float64(x * t); elseif (t <= 5.2e-145) tmp = Float64(y * 5.0); elseif (t <= 3.8e+53) tmp = Float64(2.0 * Float64(x * z)); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.4e+39) tmp = x * t; elseif (t <= 5.2e-145) tmp = y * 5.0; elseif (t <= 3.8e+53) tmp = 2.0 * (x * z); else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.4e+39], N[(x * t), $MachinePrecision], If[LessEqual[t, 5.2e-145], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 3.8e+53], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+39}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-145}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+53}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if t < -2.4000000000000001e39 or 3.79999999999999997e53 < t Initial program 99.9%
Taylor expanded in t around inf 65.8%
Simplified65.8%
if -2.4000000000000001e39 < t < 5.1999999999999999e-145Initial program 99.9%
Taylor expanded in x around 0 44.4%
if 5.1999999999999999e-145 < t < 3.79999999999999997e53Initial program 100.0%
Taylor expanded in z around inf 50.9%
Final simplification55.1%
(FPCore (x y z t)
:precision binary64
(if (<= t -3.5e+30)
(* x t)
(if (<= t 1.75e-137)
(* y (+ x 5.0))
(if (<= t 4.5e+55) (* 2.0 (* x z)) (* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.5e+30) {
tmp = x * t;
} else if (t <= 1.75e-137) {
tmp = y * (x + 5.0);
} else if (t <= 4.5e+55) {
tmp = 2.0 * (x * z);
} 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 <= (-3.5d+30)) then
tmp = x * t
else if (t <= 1.75d-137) then
tmp = y * (x + 5.0d0)
else if (t <= 4.5d+55) then
tmp = 2.0d0 * (x * z)
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 <= -3.5e+30) {
tmp = x * t;
} else if (t <= 1.75e-137) {
tmp = y * (x + 5.0);
} else if (t <= 4.5e+55) {
tmp = 2.0 * (x * z);
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.5e+30: tmp = x * t elif t <= 1.75e-137: tmp = y * (x + 5.0) elif t <= 4.5e+55: tmp = 2.0 * (x * z) else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.5e+30) tmp = Float64(x * t); elseif (t <= 1.75e-137) tmp = Float64(y * Float64(x + 5.0)); elseif (t <= 4.5e+55) tmp = Float64(2.0 * Float64(x * z)); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.5e+30) tmp = x * t; elseif (t <= 1.75e-137) tmp = y * (x + 5.0); elseif (t <= 4.5e+55) tmp = 2.0 * (x * z); else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.5e+30], N[(x * t), $MachinePrecision], If[LessEqual[t, 1.75e-137], N[(y * N[(x + 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+55], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+30}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-137}:\\
\;\;\;\;y \cdot \left(x + 5\right)\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+55}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if t < -3.50000000000000021e30 or 4.49999999999999998e55 < t Initial program 99.9%
Taylor expanded in t around inf 64.7%
Simplified64.7%
if -3.50000000000000021e30 < t < 1.7500000000000001e-137Initial program 99.9%
Taylor expanded in y around 0 86.0%
Taylor expanded in y around inf 61.3%
if 1.7500000000000001e-137 < t < 4.49999999999999998e55Initial program 100.0%
Taylor expanded in z around inf 50.9%
Final simplification61.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.18e-67) (not (<= x 8.2e-82))) (* x (+ (* 2.0 (+ y z)) t)) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.18e-67) || !(x <= 8.2e-82)) {
tmp = x * ((2.0 * (y + z)) + t);
} 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 <= (-1.18d-67)) .or. (.not. (x <= 8.2d-82))) then
tmp = x * ((2.0d0 * (y + z)) + t)
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 <= -1.18e-67) || !(x <= 8.2e-82)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.18e-67) or not (x <= 8.2e-82): tmp = x * ((2.0 * (y + z)) + t) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.18e-67) || !(x <= 8.2e-82)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); 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 <= -1.18e-67) || ~((x <= 8.2e-82))) tmp = x * ((2.0 * (y + z)) + t); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.18e-67], N[Not[LessEqual[x, 8.2e-82]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.18 \cdot 10^{-67} \lor \neg \left(x \leq 8.2 \cdot 10^{-82}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -1.18e-67 or 8.19999999999999992e-82 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 93.8%
if -1.18e-67 < x < 8.19999999999999992e-82Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 67.7%
Taylor expanded in x around 0 54.1%
Taylor expanded in x around 0 86.2%
Final simplification90.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.35e+63) (not (<= y 1.1e+41))) (* y (+ x 5.0)) (* x (+ t (* 2.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.35e+63) || !(y <= 1.1e+41)) {
tmp = y * (x + 5.0);
} else {
tmp = x * (t + (2.0 * 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 ((y <= (-1.35d+63)) .or. (.not. (y <= 1.1d+41))) then
tmp = y * (x + 5.0d0)
else
tmp = x * (t + (2.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.35e+63) || !(y <= 1.1e+41)) {
tmp = y * (x + 5.0);
} else {
tmp = x * (t + (2.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.35e+63) or not (y <= 1.1e+41): tmp = y * (x + 5.0) else: tmp = x * (t + (2.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.35e+63) || !(y <= 1.1e+41)) tmp = Float64(y * Float64(x + 5.0)); else tmp = Float64(x * Float64(t + Float64(2.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.35e+63) || ~((y <= 1.1e+41))) tmp = y * (x + 5.0); else tmp = x * (t + (2.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.35e+63], N[Not[LessEqual[y, 1.1e+41]], $MachinePrecision]], N[(y * N[(x + 5.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+63} \lor \neg \left(y \leq 1.1 \cdot 10^{+41}\right):\\
\;\;\;\;y \cdot \left(x + 5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\end{array}
\end{array}
if y < -1.35000000000000009e63 or 1.09999999999999995e41 < y Initial program 99.9%
Taylor expanded in y around 0 86.5%
Taylor expanded in y around inf 74.2%
if -1.35000000000000009e63 < y < 1.09999999999999995e41Initial program 100.0%
Taylor expanded in y around 0 79.2%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.6e+27) (not (<= y 1.4e+41))) (* y (+ 5.0 (* x 2.0))) (* x (+ t (* 2.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.6e+27) || !(y <= 1.4e+41)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (2.0 * 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 ((y <= (-7.6d+27)) .or. (.not. (y <= 1.4d+41))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (2.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.6e+27) || !(y <= 1.4e+41)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (2.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.6e+27) or not (y <= 1.4e+41): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (2.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.6e+27) || !(y <= 1.4e+41)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(2.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.6e+27) || ~((y <= 1.4e+41))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (2.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.6e+27], N[Not[LessEqual[y, 1.4e+41]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+27} \lor \neg \left(y \leq 1.4 \cdot 10^{+41}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\end{array}
\end{array}
if y < -7.60000000000000043e27 or 1.4e41 < y Initial program 99.9%
Taylor expanded in y around inf 84.7%
Simplified84.7%
if -7.60000000000000043e27 < y < 1.4e41Initial program 100.0%
Taylor expanded in y around 0 81.3%
Final simplification82.9%
(FPCore (x y z t) :precision binary64 (if (<= x -2.6e-52) (* x (+ t (* 2.0 y))) (if (<= x 2.2e-84) (* y 5.0) (* 2.0 (* x (+ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.6e-52) {
tmp = x * (t + (2.0 * y));
} else if (x <= 2.2e-84) {
tmp = y * 5.0;
} else {
tmp = 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 (x <= (-2.6d-52)) then
tmp = x * (t + (2.0d0 * y))
else if (x <= 2.2d-84) then
tmp = y * 5.0d0
else
tmp = 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 (x <= -2.6e-52) {
tmp = x * (t + (2.0 * y));
} else if (x <= 2.2e-84) {
tmp = y * 5.0;
} else {
tmp = 2.0 * (x * (y + z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.6e-52: tmp = x * (t + (2.0 * y)) elif x <= 2.2e-84: tmp = y * 5.0 else: tmp = 2.0 * (x * (y + z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.6e-52) tmp = Float64(x * Float64(t + Float64(2.0 * y))); elseif (x <= 2.2e-84) tmp = Float64(y * 5.0); else tmp = Float64(2.0 * Float64(x * Float64(y + z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.6e-52) tmp = x * (t + (2.0 * y)); elseif (x <= 2.2e-84) tmp = y * 5.0; else tmp = 2.0 * (x * (y + z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.6e-52], N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e-84], N[(y * 5.0), $MachinePrecision], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-52}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-84}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\end{array}
\end{array}
if x < -2.5999999999999999e-52Initial program 100.0%
Taylor expanded in y around inf 75.5%
Taylor expanded in x around inf 70.9%
if -2.5999999999999999e-52 < x < 2.1999999999999999e-84Initial program 99.9%
Taylor expanded in x around 0 63.4%
if 2.1999999999999999e-84 < x Initial program 100.0%
Taylor expanded in y around 0 95.8%
Taylor expanded in x around inf 89.2%
Simplified89.2%
Taylor expanded in t around 0 66.3%
*-commutative66.3%
*-commutative66.3%
associate-*r*66.3%
*-commutative66.3%
associate-*r*66.3%
*-commutative66.3%
distribute-lft-out67.7%
associate-*r*67.7%
distribute-lft-out67.7%
*-commutative67.7%
distribute-lft-out67.7%
associate-*l*67.7%
Simplified67.7%
Final simplification66.9%
(FPCore (x y z t) :precision binary64 (+ (* x (+ t (* 2.0 z))) (* y (+ 5.0 (* x 2.0)))))
double code(double x, double y, double z, double t) {
return (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.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 * (t + (2.0d0 * z))) + (y * (5.0d0 + (x * 2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0)));
}
def code(x, y, z, t): return (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0)))
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(2.0 * z))) + Float64(y * Float64(5.0 + Float64(x * 2.0)))) end
function tmp = code(x, y, z, t) tmp = (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0))); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + 2 \cdot z\right) + y \cdot \left(5 + x \cdot 2\right)
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 97.2%
Final simplification97.2%
(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 (<= t -1.02e+39) (not (<= t 5.8e+26))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.02e+39) || !(t <= 5.8e+26)) {
tmp = x * t;
} else {
tmp = y * 5.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 ((t <= (-1.02d+39)) .or. (.not. (t <= 5.8d+26))) then
tmp = x * t
else
tmp = y * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.02e+39) || !(t <= 5.8e+26)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.02e+39) or not (t <= 5.8e+26): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.02e+39) || !(t <= 5.8e+26)) tmp = Float64(x * t); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.02e+39) || ~((t <= 5.8e+26))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.02e+39], N[Not[LessEqual[t, 5.8e+26]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{+39} \lor \neg \left(t \leq 5.8 \cdot 10^{+26}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if t < -1.02e39 or 5.8e26 < t Initial program 99.9%
Taylor expanded in t around inf 64.5%
Simplified64.5%
if -1.02e39 < t < 5.8e26Initial program 99.9%
Taylor expanded in x around 0 39.4%
Final simplification51.3%
(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 30.3%
Final simplification30.3%
herbie shell --seed 2024054
(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)))