
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (- (+ x (+ y (+ z (+ (* -0.5 b) (* b a))))) (* z (log t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * log(t));
}
real(8) function code(x, y, z, t, a, b)
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
code = (x + (y + (z + (((-0.5d0) * b) + (b * a))))) - (z * log(t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * Math.log(t));
}
def code(x, y, z, t, a, b): return (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * math.log(t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(y + Float64(z + Float64(Float64(-0.5 * b) + Float64(b * a))))) - Float64(z * log(t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * log(t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(y + N[(z + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \left(y + \left(z + \left(-0.5 \cdot b + b \cdot a\right)\right)\right)\right) - z \cdot \log t
\end{array}
Initial program 99.9%
Taylor expanded in a around 0 99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (log t))) (t_2 (+ z (* b (- a 0.5))))) (if (<= (+ x y) -2e-107) (- (+ x t_2) t_1) (- (+ y t_2) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double t_2 = z + (b * (a - 0.5));
double tmp;
if ((x + y) <= -2e-107) {
tmp = (x + t_2) - t_1;
} else {
tmp = (y + t_2) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * log(t)
t_2 = z + (b * (a - 0.5d0))
if ((x + y) <= (-2d-107)) then
tmp = (x + t_2) - t_1
else
tmp = (y + 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 t_1 = z * Math.log(t);
double t_2 = z + (b * (a - 0.5));
double tmp;
if ((x + y) <= -2e-107) {
tmp = (x + t_2) - t_1;
} else {
tmp = (y + t_2) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = z + (b * (a - 0.5)) tmp = 0 if (x + y) <= -2e-107: tmp = (x + t_2) - t_1 else: tmp = (y + t_2) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(z + Float64(b * Float64(a - 0.5))) tmp = 0.0 if (Float64(x + y) <= -2e-107) tmp = Float64(Float64(x + t_2) - t_1); else tmp = Float64(Float64(y + t_2) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); t_2 = z + (b * (a - 0.5)); tmp = 0.0; if ((x + y) <= -2e-107) tmp = (x + t_2) - t_1; else tmp = (y + t_2) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -2e-107], N[(N[(x + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(y + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := z + b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -2 \cdot 10^{-107}:\\
\;\;\;\;\left(x + t\_2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + t\_2\right) - t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -2e-107Initial program 99.9%
Taylor expanded in y around 0 74.8%
if -2e-107 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 79.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))))
(if (<= (+ x y) 2e+28)
(- (+ x (+ z (* b (- a 0.5)))) t_1)
(- (+ y (+ z (* -0.5 b))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double tmp;
if ((x + y) <= 2e+28) {
tmp = (x + (z + (b * (a - 0.5)))) - t_1;
} else {
tmp = (y + (z + (-0.5 * b))) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = z * log(t)
if ((x + y) <= 2d+28) then
tmp = (x + (z + (b * (a - 0.5d0)))) - t_1
else
tmp = (y + (z + ((-0.5d0) * b))) - 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 t_1 = z * Math.log(t);
double tmp;
if ((x + y) <= 2e+28) {
tmp = (x + (z + (b * (a - 0.5)))) - t_1;
} else {
tmp = (y + (z + (-0.5 * b))) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) tmp = 0 if (x + y) <= 2e+28: tmp = (x + (z + (b * (a - 0.5)))) - t_1 else: tmp = (y + (z + (-0.5 * b))) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) tmp = 0.0 if (Float64(x + y) <= 2e+28) tmp = Float64(Float64(x + Float64(z + Float64(b * Float64(a - 0.5)))) - t_1); else tmp = Float64(Float64(y + Float64(z + Float64(-0.5 * b))) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); tmp = 0.0; if ((x + y) <= 2e+28) tmp = (x + (z + (b * (a - 0.5)))) - t_1; else tmp = (y + (z + (-0.5 * b))) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], 2e+28], N[(N[(x + N[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(y + N[(z + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;x + y \leq 2 \cdot 10^{+28}:\\
\;\;\;\;\left(x + \left(z + b \cdot \left(a - 0.5\right)\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + -0.5 \cdot b\right)\right) - t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < 1.99999999999999992e28Initial program 99.8%
Taylor expanded in y around 0 80.3%
if 1.99999999999999992e28 < (+.f64 x y) Initial program 100.0%
Taylor expanded in x around 0 68.3%
Taylor expanded in a around 0 57.3%
Final simplification72.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -7e+182)
(+ (* b (- a 0.5)) (- z (* z (log t))))
(if (<= z 3.1e+203)
(+ x (+ y (+ (* -0.5 b) (* b a))))
(+ (+ x y) (* z (- 1.0 (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7e+182) {
tmp = (b * (a - 0.5)) + (z - (z * log(t)));
} else if (z <= 3.1e+203) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} else {
tmp = (x + y) + (z * (1.0 - log(t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-7d+182)) then
tmp = (b * (a - 0.5d0)) + (z - (z * log(t)))
else if (z <= 3.1d+203) then
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
else
tmp = (x + y) + (z * (1.0d0 - log(t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7e+182) {
tmp = (b * (a - 0.5)) + (z - (z * Math.log(t)));
} else if (z <= 3.1e+203) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} else {
tmp = (x + y) + (z * (1.0 - Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -7e+182: tmp = (b * (a - 0.5)) + (z - (z * math.log(t))) elif z <= 3.1e+203: tmp = x + (y + ((-0.5 * b) + (b * a))) else: tmp = (x + y) + (z * (1.0 - math.log(t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7e+182) tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(z - Float64(z * log(t)))); elseif (z <= 3.1e+203) tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); else tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -7e+182) tmp = (b * (a - 0.5)) + (z - (z * log(t))); elseif (z <= 3.1e+203) tmp = x + (y + ((-0.5 * b) + (b * a))); else tmp = (x + y) + (z * (1.0 - log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7e+182], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+203], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+182}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(z - z \cdot \log t\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+203}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if z < -7.00000000000000045e182Initial program 99.8%
Taylor expanded in z around inf 87.4%
if -7.00000000000000045e182 < z < 3.1e203Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 92.7%
if 3.1e203 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 96.4%
Final simplification92.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -2.05e+183)
(+ (* b a) t_1)
(if (<= z 2.15e+204)
(+ x (+ y (+ (* -0.5 b) (* b a))))
(+ (+ x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - log(t));
double tmp;
if (z <= -2.05e+183) {
tmp = (b * a) + t_1;
} else if (z <= 2.15e+204) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} else {
tmp = (x + y) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = z * (1.0d0 - log(t))
if (z <= (-2.05d+183)) then
tmp = (b * a) + t_1
else if (z <= 2.15d+204) then
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
else
tmp = (x + y) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -2.05e+183) {
tmp = (b * a) + t_1;
} else if (z <= 2.15e+204) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} else {
tmp = (x + y) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -2.05e+183: tmp = (b * a) + t_1 elif z <= 2.15e+204: tmp = x + (y + ((-0.5 * b) + (b * a))) else: tmp = (x + y) + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -2.05e+183) tmp = Float64(Float64(b * a) + t_1); elseif (z <= 2.15e+204) tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); else tmp = Float64(Float64(x + y) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (1.0 - log(t)); tmp = 0.0; if (z <= -2.05e+183) tmp = (b * a) + t_1; elseif (z <= 2.15e+204) tmp = x + (y + ((-0.5 * b) + (b * a))); else tmp = (x + y) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e+183], N[(N[(b * a), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 2.15e+204], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+183}:\\
\;\;\;\;b \cdot a + t\_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+204}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\end{array}
\end{array}
if z < -2.05000000000000007e183Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 81.0%
*-commutative81.0%
Simplified81.0%
if -2.05000000000000007e183 < z < 2.15e204Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 92.7%
if 2.15e204 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 96.4%
Final simplification91.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.5e+235) (not (<= z 4.8e+204))) (+ y (* z (- 1.0 (log t)))) (+ x (+ y (+ (* -0.5 b) (* b a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.5e+235) || !(z <= 4.8e+204)) {
tmp = y + (z * (1.0 - log(t)));
} else {
tmp = x + (y + ((-0.5 * b) + (b * a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((z <= (-8.5d+235)) .or. (.not. (z <= 4.8d+204))) then
tmp = y + (z * (1.0d0 - log(t)))
else
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.5e+235) || !(z <= 4.8e+204)) {
tmp = y + (z * (1.0 - Math.log(t)));
} else {
tmp = x + (y + ((-0.5 * b) + (b * a)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.5e+235) or not (z <= 4.8e+204): tmp = y + (z * (1.0 - math.log(t))) else: tmp = x + (y + ((-0.5 * b) + (b * a))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.5e+235) || !(z <= 4.8e+204)) tmp = Float64(y + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.5e+235) || ~((z <= 4.8e+204))) tmp = y + (z * (1.0 - log(t))); else tmp = x + (y + ((-0.5 * b) + (b * a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.5e+235], N[Not[LessEqual[z, 4.8e+204]], $MachinePrecision]], N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+235} \lor \neg \left(z \leq 4.8 \cdot 10^{+204}\right):\\
\;\;\;\;y + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\end{array}
\end{array}
if z < -8.50000000000000017e235 or 4.7999999999999999e204 < z Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 79.2%
if -8.50000000000000017e235 < z < 4.7999999999999999e204Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.1%
Final simplification88.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -4.1e+182)
(+ (* b a) t_1)
(if (<= z 2.9e+203) (+ x (+ y (+ (* -0.5 b) (* b a)))) (+ y t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - log(t));
double tmp;
if (z <= -4.1e+182) {
tmp = (b * a) + t_1;
} else if (z <= 2.9e+203) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} else {
tmp = y + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = z * (1.0d0 - log(t))
if (z <= (-4.1d+182)) then
tmp = (b * a) + t_1
else if (z <= 2.9d+203) then
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
else
tmp = y + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -4.1e+182) {
tmp = (b * a) + t_1;
} else if (z <= 2.9e+203) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -4.1e+182: tmp = (b * a) + t_1 elif z <= 2.9e+203: tmp = x + (y + ((-0.5 * b) + (b * a))) else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -4.1e+182) tmp = Float64(Float64(b * a) + t_1); elseif (z <= 2.9e+203) tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (1.0 - log(t)); tmp = 0.0; if (z <= -4.1e+182) tmp = (b * a) + t_1; elseif (z <= 2.9e+203) tmp = x + (y + ((-0.5 * b) + (b * a))); else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+182], N[(N[(b * a), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 2.9e+203], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+182}:\\
\;\;\;\;b \cdot a + t\_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+203}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if z < -4.10000000000000003e182Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 81.0%
*-commutative81.0%
Simplified81.0%
if -4.10000000000000003e182 < z < 2.90000000000000011e203Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 92.7%
if 2.90000000000000011e203 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 87.6%
Final simplification90.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.9e+236)
(- z (* z (log t)))
(if (<= z 9e+203)
(+ x (+ y (+ (* -0.5 b) (* b a))))
(+ x (* z (- 1.0 (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.9e+236) {
tmp = z - (z * log(t));
} else if (z <= 9e+203) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} else {
tmp = x + (z * (1.0 - log(t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-2.9d+236)) then
tmp = z - (z * log(t))
else if (z <= 9d+203) then
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
else
tmp = x + (z * (1.0d0 - log(t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.9e+236) {
tmp = z - (z * Math.log(t));
} else if (z <= 9e+203) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} else {
tmp = x + (z * (1.0 - Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.9e+236: tmp = z - (z * math.log(t)) elif z <= 9e+203: tmp = x + (y + ((-0.5 * b) + (b * a))) else: tmp = x + (z * (1.0 - math.log(t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.9e+236) tmp = Float64(z - Float64(z * log(t))); elseif (z <= 9e+203) tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); else tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.9e+236) tmp = z - (z * log(t)); elseif (z <= 9e+203) tmp = x + (y + ((-0.5 * b) + (b * a))); else tmp = x + (z * (1.0 - log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.9e+236], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+203], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+236}:\\
\;\;\;\;z - z \cdot \log t\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+203}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if z < -2.9000000000000001e236Initial program 99.9%
Taylor expanded in z around inf 95.2%
Taylor expanded in b around 0 68.2%
if -2.9000000000000001e236 < z < 9.0000000000000006e203Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.1%
if 9.0000000000000006e203 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 85.0%
Final simplification87.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.5e+235) (not (<= z 1.7e+205))) (* z (- 1.0 (log t))) (+ x (+ y (+ (* -0.5 b) (* b a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.5e+235) || !(z <= 1.7e+205)) {
tmp = z * (1.0 - log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (b * a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((z <= (-8.5d+235)) .or. (.not. (z <= 1.7d+205))) then
tmp = z * (1.0d0 - log(t))
else
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.5e+235) || !(z <= 1.7e+205)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (b * a)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.5e+235) or not (z <= 1.7e+205): tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + ((-0.5 * b) + (b * a))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.5e+235) || !(z <= 1.7e+205)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.5e+235) || ~((z <= 1.7e+205))) tmp = z * (1.0 - log(t)); else tmp = x + (y + ((-0.5 * b) + (b * a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.5e+235], N[Not[LessEqual[z, 1.7e+205]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+235} \lor \neg \left(z \leq 1.7 \cdot 10^{+205}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\end{array}
\end{array}
if z < -8.50000000000000017e235 or 1.7e205 < z Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 79.9%
Taylor expanded in z around inf 73.5%
if -8.50000000000000017e235 < z < 1.7e205Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.1%
Final simplification86.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.1e+236)
(- z (* z (log t)))
(if (<= z 5.6e+204)
(+ x (+ y (+ (* -0.5 b) (* b a))))
(* z (- 1.0 (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.1e+236) {
tmp = z - (z * log(t));
} else if (z <= 5.6e+204) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} else {
tmp = z * (1.0 - log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-1.1d+236)) then
tmp = z - (z * log(t))
else if (z <= 5.6d+204) then
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
else
tmp = z * (1.0d0 - log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.1e+236) {
tmp = z - (z * Math.log(t));
} else if (z <= 5.6e+204) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} else {
tmp = z * (1.0 - Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.1e+236: tmp = z - (z * math.log(t)) elif z <= 5.6e+204: tmp = x + (y + ((-0.5 * b) + (b * a))) else: tmp = z * (1.0 - math.log(t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.1e+236) tmp = Float64(z - Float64(z * log(t))); elseif (z <= 5.6e+204) tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); else tmp = Float64(z * Float64(1.0 - log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.1e+236) tmp = z - (z * log(t)); elseif (z <= 5.6e+204) tmp = x + (y + ((-0.5 * b) + (b * a))); else tmp = z * (1.0 - log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.1e+236], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+204], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+236}:\\
\;\;\;\;z - z \cdot \log t\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+204}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if z < -1.09999999999999989e236Initial program 99.9%
Taylor expanded in z around inf 95.2%
Taylor expanded in b around 0 68.2%
if -1.09999999999999989e236 < z < 5.60000000000000049e204Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.1%
if 5.60000000000000049e204 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 85.0%
Taylor expanded in z around inf 77.4%
Final simplification86.9%
(FPCore (x y z t a b) :precision binary64 (+ (- (+ z (+ x y)) (* z (log t))) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5));
}
real(8) function code(x, y, z, t, a, b)
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
code = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * Math.log(t))) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return ((z + (x + y)) - (z * math.log(t))) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z + Float64(x + y)) - Float64(z * log(t))) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -0.0012) (not (<= b 1.55e+82))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -0.0012) || !(b <= 1.55e+82)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((b <= (-0.0012d0)) .or. (.not. (b <= 1.55d+82))) then
tmp = b * (a - 0.5d0)
else
tmp = 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 tmp;
if ((b <= -0.0012) || !(b <= 1.55e+82)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -0.0012) or not (b <= 1.55e+82): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -0.0012) || !(b <= 1.55e+82)) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -0.0012) || ~((b <= 1.55e+82))) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -0.0012], N[Not[LessEqual[b, 1.55e+82]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.0012 \lor \neg \left(b \leq 1.55 \cdot 10^{+82}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -0.00119999999999999989 or 1.55000000000000016e82 < b Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 83.6%
distribute-rgt-in83.6%
associate-+r+83.6%
+-commutative83.6%
Simplified83.6%
Taylor expanded in x around -inf 69.2%
Taylor expanded in b around inf 64.9%
mul-1-neg64.9%
sub-neg64.9%
metadata-eval64.9%
+-commutative64.9%
distribute-lft-out64.9%
+-commutative64.9%
distribute-lft-in64.9%
distribute-rgt-neg-in64.9%
+-commutative64.9%
distribute-neg-in64.9%
metadata-eval64.9%
mul-1-neg64.9%
mul-1-neg64.9%
unsub-neg64.9%
Simplified64.9%
if -0.00119999999999999989 < b < 1.55000000000000016e82Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 72.8%
distribute-rgt-in72.8%
associate-+r+72.8%
+-commutative72.8%
Simplified72.8%
Taylor expanded in b around 0 63.7%
+-commutative63.7%
Simplified63.7%
Final simplification64.2%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -4e-173) (+ x (* b (- a 0.5))) (- y (* b (- 0.5 a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -4e-173) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y - (b * (0.5 - a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((x + y) <= (-4d-173)) then
tmp = x + (b * (a - 0.5d0))
else
tmp = y - (b * (0.5d0 - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -4e-173) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y - (b * (0.5 - a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -4e-173: tmp = x + (b * (a - 0.5)) else: tmp = y - (b * (0.5 - a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -4e-173) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(y - Float64(b * Float64(0.5 - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -4e-173) tmp = x + (b * (a - 0.5)); else tmp = y - (b * (0.5 - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -4e-173], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y - N[(b * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -4 \cdot 10^{-173}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y - b \cdot \left(0.5 - a\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -4.0000000000000002e-173Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 80.7%
distribute-rgt-in80.7%
associate-+r+80.7%
+-commutative80.7%
Simplified80.7%
Taylor expanded in y around 0 57.2%
if -4.0000000000000002e-173 < (+.f64 x y) Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 74.6%
distribute-rgt-in74.6%
associate-+r+74.6%
+-commutative74.6%
Simplified74.6%
Taylor expanded in x around -inf 60.2%
Taylor expanded in x around 0 53.1%
Final simplification55.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5e+80) (not (<= b 2.7e+100))) (* b a) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5e+80) || !(b <= 2.7e+100)) {
tmp = b * a;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((b <= (-5d+80)) .or. (.not. (b <= 2.7d+100))) then
tmp = b * a
else
tmp = 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 tmp;
if ((b <= -5e+80) || !(b <= 2.7e+100)) {
tmp = b * a;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5e+80) or not (b <= 2.7e+100): tmp = b * a else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5e+80) || !(b <= 2.7e+100)) tmp = Float64(b * a); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5e+80) || ~((b <= 2.7e+100))) tmp = b * a; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5e+80], N[Not[LessEqual[b, 2.7e+100]], $MachinePrecision]], N[(b * a), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+80} \lor \neg \left(b \leq 2.7 \cdot 10^{+100}\right):\\
\;\;\;\;b \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -4.99999999999999961e80 or 2.69999999999999998e100 < b Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 85.6%
distribute-rgt-in85.6%
associate-+r+85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in x around -inf 71.5%
Taylor expanded in a around inf 44.4%
associate-*r*44.4%
mul-1-neg44.4%
Simplified44.4%
if -4.99999999999999961e80 < b < 2.69999999999999998e100Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 72.9%
distribute-rgt-in72.9%
associate-+r+72.9%
+-commutative72.9%
Simplified72.9%
Taylor expanded in b around 0 60.6%
+-commutative60.6%
Simplified60.6%
Final simplification54.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 7e+86) (+ x (* b (- a 0.5))) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 7e+86) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (y <= 7d+86) then
tmp = x + (b * (a - 0.5d0))
else
tmp = 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 tmp;
if (y <= 7e+86) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 7e+86: tmp = x + (b * (a - 0.5)) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 7e+86) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 7e+86) tmp = x + (b * (a - 0.5)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 7e+86], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7 \cdot 10^{+86}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < 7.00000000000000038e86Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 76.4%
distribute-rgt-in76.3%
associate-+r+76.3%
+-commutative76.3%
Simplified76.3%
Taylor expanded in y around 0 60.6%
if 7.00000000000000038e86 < y Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 82.2%
distribute-rgt-in82.2%
associate-+r+82.2%
+-commutative82.2%
Simplified82.2%
Taylor expanded in b around 0 64.4%
+-commutative64.4%
Simplified64.4%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (+ (* -0.5 b) (* b a)))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((-0.5 * b) + (b * a)));
}
real(8) function code(x, y, z, t, a, b)
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
code = x + (y + (((-0.5d0) * b) + (b * a)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((-0.5 * b) + (b * a)));
}
def code(x, y, z, t, a, b): return x + (y + ((-0.5 * b) + (b * a)))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + ((-0.5 * b) + (b * a))); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 77.5%
Final simplification77.5%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (* b (+ -0.5 a))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (-0.5 + a));
}
real(8) function code(x, y, z, t, a, b)
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
code = (x + y) + (b * ((-0.5d0) + a))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (-0.5 + a));
}
def code(x, y, z, t, a, b): return (x + y) + (b * (-0.5 + a))
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(b * Float64(-0.5 + a))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + (b * (-0.5 + a)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(b * N[(-0.5 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + b \cdot \left(-0.5 + a\right)
\end{array}
Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 77.5%
distribute-rgt-in77.5%
associate-+r+77.5%
+-commutative77.5%
Simplified77.5%
Final simplification77.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.7e+87) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.7e+87) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (x <= (-1.7d+87)) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.7e+87) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.7e+87: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.7e+87) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.7e+87) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.7e+87], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+87}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.7000000000000001e87Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 65.5%
Taylor expanded in z around 0 50.8%
if -1.7000000000000001e87 < x Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 75.7%
distribute-rgt-in75.7%
associate-+r+75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in y around inf 27.8%
(FPCore (x y z t a b) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a, double b) {
return x + y;
}
real(8) function code(x, y, z, t, a, b)
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
code = x + y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + y;
}
def code(x, y, z, t, a, b): return x + y
function code(x, y, z, t, a, b) return Float64(x + y) end
function tmp = code(x, y, z, t, a, b) tmp = x + y; end
code[x_, y_, z_, t_, a_, b_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 77.5%
distribute-rgt-in77.5%
associate-+r+77.5%
+-commutative77.5%
Simplified77.5%
Taylor expanded in b around 0 45.1%
+-commutative45.1%
Simplified45.1%
Final simplification45.1%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
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
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 44.3%
Taylor expanded in z around 0 22.3%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((x + y) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}
herbie shell --seed 2024165
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))