
(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 17 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 (+ (* z (- 1.0 (log t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * (1.0 - log(t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * Float64(1.0 - log(t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\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%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -1e-28) (not (<= t_1 2e+130)))
(+ (+ x y) t_1)
(+ x (+ (* z (- 1.0 (log t))) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -1e-28) || !(t_1 <= 2e+130)) {
tmp = (x + y) + t_1;
} else {
tmp = x + ((z * (1.0 - log(t))) + 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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-1d-28)) .or. (.not. (t_1 <= 2d+130))) then
tmp = (x + y) + t_1
else
tmp = x + ((z * (1.0d0 - log(t))) + y)
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 = b * (a - 0.5);
double tmp;
if ((t_1 <= -1e-28) || !(t_1 <= 2e+130)) {
tmp = (x + y) + t_1;
} else {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -1e-28) or not (t_1 <= 2e+130): tmp = (x + y) + t_1 else: tmp = x + ((z * (1.0 - math.log(t))) + y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -1e-28) || !(t_1 <= 2e+130)) tmp = Float64(Float64(x + y) + t_1); else tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -1e-28) || ~((t_1 <= 2e+130))) tmp = (x + y) + t_1; else tmp = x + ((z * (1.0 - log(t))) + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-28], N[Not[LessEqual[t$95$1, 2e+130]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-28} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+130}\right):\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.99999999999999971e-29 or 2.0000000000000001e130 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in z around 0 91.0%
if -9.99999999999999971e-29 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.0000000000000001e130Initial 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 b around 0 96.6%
Final simplification93.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= (+ x y) 1e-25)
(+ x (+ (* z (- 1.0 (log t))) t_1))
(if (<= (+ x y) 3e+93) (- (+ z y) (* z (log t))) (+ y t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 1e-25) {
tmp = x + ((z * (1.0 - log(t))) + t_1);
} else if ((x + y) <= 3e+93) {
tmp = (z + y) - (z * log(t));
} 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 = b * (a - 0.5d0)
if ((x + y) <= 1d-25) then
tmp = x + ((z * (1.0d0 - log(t))) + t_1)
else if ((x + y) <= 3d+93) then
tmp = (z + y) - (z * log(t))
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 = b * (a - 0.5);
double tmp;
if ((x + y) <= 1e-25) {
tmp = x + ((z * (1.0 - Math.log(t))) + t_1);
} else if ((x + y) <= 3e+93) {
tmp = (z + y) - (z * Math.log(t));
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= 1e-25: tmp = x + ((z * (1.0 - math.log(t))) + t_1) elif (x + y) <= 3e+93: tmp = (z + y) - (z * math.log(t)) else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= 1e-25) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + t_1)); elseif (Float64(x + y) <= 3e+93) tmp = Float64(Float64(z + y) - Float64(z * log(t))); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= 1e-25) tmp = x + ((z * (1.0 - log(t))) + t_1); elseif ((x + y) <= 3e+93) tmp = (z + y) - (z * log(t)); else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], 1e-25], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 3e+93], N[(N[(z + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq 10^{-25}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + t\_1\right)\\
\mathbf{elif}\;x + y \leq 3 \cdot 10^{+93}:\\
\;\;\;\;\left(z + y\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < 1.00000000000000004e-25Initial 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 y around 0 81.2%
if 1.00000000000000004e-25 < (+.f64 x y) < 2.99999999999999978e93Initial program 99.9%
Taylor expanded in x around 0 78.7%
Taylor expanded in b around 0 56.7%
+-commutative56.7%
Simplified56.7%
if 2.99999999999999978e93 < (+.f64 x y) Initial program 100.0%
Taylor expanded in x around inf 85.7%
Taylor expanded in y around inf 64.3%
Final simplification73.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= (+ x y) 2e-53)
(+ x (+ (* z (- 1.0 (log t))) t_1))
(- (+ y (+ z t_1)) (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 2e-53) {
tmp = x + ((z * (1.0 - log(t))) + t_1);
} else {
tmp = (y + (z + t_1)) - (z * 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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= 2d-53) then
tmp = x + ((z * (1.0d0 - log(t))) + t_1)
else
tmp = (y + (z + t_1)) - (z * 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 t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 2e-53) {
tmp = x + ((z * (1.0 - Math.log(t))) + t_1);
} else {
tmp = (y + (z + t_1)) - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= 2e-53: tmp = x + ((z * (1.0 - math.log(t))) + t_1) else: tmp = (y + (z + t_1)) - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= 2e-53) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + t_1)); else tmp = Float64(Float64(y + Float64(z + t_1)) - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= 2e-53) tmp = x + ((z * (1.0 - log(t))) + t_1); else tmp = (y + (z + t_1)) - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], 2e-53], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq 2 \cdot 10^{-53}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + t\_1\right)\right) - z \cdot \log t\\
\end{array}
\end{array}
if (+.f64 x y) < 2.00000000000000006e-53Initial 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 y around 0 80.5%
if 2.00000000000000006e-53 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 76.0%
Final simplification78.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.5e+148) (not (<= z 3e+130))) (+ (* z (- 1.0 (log t))) x) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.5e+148) || !(z <= 3e+130)) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = (x + y) + (b * (a - 0.5));
}
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 <= (-5.5d+148)) .or. (.not. (z <= 3d+130))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = (x + y) + (b * (a - 0.5d0))
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 <= -5.5e+148) || !(z <= 3e+130)) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.5e+148) or not (z <= 3e+130): tmp = (z * (1.0 - math.log(t))) + x else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.5e+148) || !(z <= 3e+130)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5.5e+148) || ~((z <= 3e+130))) tmp = (z * (1.0 - log(t))) + x; else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.5e+148], N[Not[LessEqual[z, 3e+130]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+148} \lor \neg \left(z \leq 3 \cdot 10^{+130}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -5.5e148 or 2.9999999999999999e130 < z Initial program 99.7%
+-commutative99.7%
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 0 88.4%
Taylor expanded in b around 0 66.0%
if -5.5e148 < z < 2.9999999999999999e130Initial program 100.0%
Taylor expanded in z around 0 94.5%
Final simplification87.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5.4e+148) (+ (* z (- 1.0 (log t))) x) (if (<= z 4.8e+147) (+ (+ x y) (* b (- a 0.5))) (- (+ z y) (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.4e+148) {
tmp = (z * (1.0 - log(t))) + x;
} else if (z <= 4.8e+147) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = (z + y) - (z * 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 <= (-5.4d+148)) then
tmp = (z * (1.0d0 - log(t))) + x
else if (z <= 4.8d+147) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = (z + y) - (z * 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 <= -5.4e+148) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else if (z <= 4.8e+147) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = (z + y) - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -5.4e+148: tmp = (z * (1.0 - math.log(t))) + x elif z <= 4.8e+147: tmp = (x + y) + (b * (a - 0.5)) else: tmp = (z + y) - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.4e+148) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); elseif (z <= 4.8e+147) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(Float64(z + y) - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -5.4e+148) tmp = (z * (1.0 - log(t))) + x; elseif (z <= 4.8e+147) tmp = (x + y) + (b * (a - 0.5)); else tmp = (z + y) - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.4e+148], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 4.8e+147], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+148}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+147}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + y\right) - z \cdot \log t\\
\end{array}
\end{array}
if z < -5.40000000000000038e148Initial 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.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 89.1%
Taylor expanded in b around 0 69.8%
if -5.40000000000000038e148 < z < 4.80000000000000004e147Initial program 100.0%
Taylor expanded in z around 0 94.6%
if 4.80000000000000004e147 < z Initial program 99.7%
Taylor expanded in x around 0 89.4%
Taylor expanded in b around 0 64.0%
+-commutative64.0%
Simplified64.0%
Final simplification87.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -4.6e+148)
(+ t_1 x)
(if (<= z 3e+141) (+ (+ x y) (* b (- a 0.5))) (+ t_1 y)))))
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.6e+148) {
tmp = t_1 + x;
} else if (z <= 3e+141) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1 + 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) :: t_1
real(8) :: tmp
t_1 = z * (1.0d0 - log(t))
if (z <= (-4.6d+148)) then
tmp = t_1 + x
else if (z <= 3d+141) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = t_1 + y
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.6e+148) {
tmp = t_1 + x;
} else if (z <= 3e+141) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1 + y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -4.6e+148: tmp = t_1 + x elif z <= 3e+141: tmp = (x + y) + (b * (a - 0.5)) else: tmp = t_1 + y 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.6e+148) tmp = Float64(t_1 + x); elseif (z <= 3e+141) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(t_1 + y); 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.6e+148) tmp = t_1 + x; elseif (z <= 3e+141) tmp = (x + y) + (b * (a - 0.5)); else tmp = t_1 + y; 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.6e+148], N[(t$95$1 + x), $MachinePrecision], If[LessEqual[z, 3e+141], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+148}:\\
\;\;\;\;t\_1 + x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+141}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + y\\
\end{array}
\end{array}
if z < -4.6000000000000001e148Initial 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.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 89.1%
Taylor expanded in b around 0 69.8%
if -4.6000000000000001e148 < z < 2.9999999999999999e141Initial program 100.0%
Taylor expanded in z around 0 94.6%
if 2.9999999999999999e141 < z Initial program 99.7%
Taylor expanded in x around 0 89.4%
Taylor expanded in b around 0 64.0%
associate--l+64.0%
+-commutative64.0%
sub-neg64.0%
*-rgt-identity64.0%
distribute-rgt-neg-in64.0%
log-rec64.0%
distribute-lft-in64.0%
log-rec64.0%
sub-neg64.0%
Simplified64.0%
Final simplification87.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.5e+207) (not (<= z 2.4e+225))) (* z (- 1.0 (log t))) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.5e+207) || !(z <= 2.4e+225)) {
tmp = z * (1.0 - log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
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.5d+207)) .or. (.not. (z <= 2.4d+225))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (x + y) + (b * (a - 0.5d0))
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.5e+207) || !(z <= 2.4e+225)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.5e+207) or not (z <= 2.4e+225): tmp = z * (1.0 - math.log(t)) else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.5e+207) || !(z <= 2.4e+225)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.5e+207) || ~((z <= 2.4e+225))) tmp = z * (1.0 - log(t)); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.5e+207], N[Not[LessEqual[z, 2.4e+225]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+207} \lor \neg \left(z \leq 2.4 \cdot 10^{+225}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -1.49999999999999992e207 or 2.4000000000000001e225 < z Initial program 99.6%
Taylor expanded in x around 0 90.7%
Taylor expanded in b around 0 71.5%
associate--l+71.5%
+-commutative71.5%
sub-neg71.5%
*-rgt-identity71.5%
distribute-rgt-neg-in71.5%
log-rec71.5%
distribute-lft-in71.6%
log-rec71.6%
sub-neg71.6%
Simplified71.6%
Taylor expanded in z around inf 66.4%
if -1.49999999999999992e207 < z < 2.4000000000000001e225Initial program 99.9%
Taylor expanded in z around 0 89.1%
Final simplification85.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 (<= y 5.5e-265)
x
(if (<= y 8.3e-191)
(* a b)
(if (<= y 4e-174) (* -0.5 b) (if (<= y 2.7e+126) (* a b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 5.5e-265) {
tmp = x;
} else if (y <= 8.3e-191) {
tmp = a * b;
} else if (y <= 4e-174) {
tmp = -0.5 * b;
} else if (y <= 2.7e+126) {
tmp = a * b;
} 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 (y <= 5.5d-265) then
tmp = x
else if (y <= 8.3d-191) then
tmp = a * b
else if (y <= 4d-174) then
tmp = (-0.5d0) * b
else if (y <= 2.7d+126) then
tmp = a * b
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 (y <= 5.5e-265) {
tmp = x;
} else if (y <= 8.3e-191) {
tmp = a * b;
} else if (y <= 4e-174) {
tmp = -0.5 * b;
} else if (y <= 2.7e+126) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 5.5e-265: tmp = x elif y <= 8.3e-191: tmp = a * b elif y <= 4e-174: tmp = -0.5 * b elif y <= 2.7e+126: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 5.5e-265) tmp = x; elseif (y <= 8.3e-191) tmp = Float64(a * b); elseif (y <= 4e-174) tmp = Float64(-0.5 * b); elseif (y <= 2.7e+126) tmp = Float64(a * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 5.5e-265) tmp = x; elseif (y <= 8.3e-191) tmp = a * b; elseif (y <= 4e-174) tmp = -0.5 * b; elseif (y <= 2.7e+126) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 5.5e-265], x, If[LessEqual[y, 8.3e-191], N[(a * b), $MachinePrecision], If[LessEqual[y, 4e-174], N[(-0.5 * b), $MachinePrecision], If[LessEqual[y, 2.7e+126], N[(a * b), $MachinePrecision], y]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.5 \cdot 10^{-265}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 8.3 \cdot 10^{-191}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-174}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+126}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 5.49999999999999985e-265Initial 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 22.7%
if 5.49999999999999985e-265 < y < 8.3000000000000005e-191 or 4e-174 < y < 2.70000000000000002e126Initial 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 a around inf 31.2%
*-commutative31.2%
Simplified31.2%
if 8.3000000000000005e-191 < y < 4e-174Initial 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 b around inf 67.8%
Taylor expanded in a around 0 50.8%
if 2.70000000000000002e126 < y Initial 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 y around inf 72.1%
Final simplification32.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6e+66) (not (<= b 2.3e+57))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6e+66) || !(b <= 2.3e+57)) {
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 <= (-6d+66)) .or. (.not. (b <= 2.3d+57))) 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 <= -6e+66) || !(b <= 2.3e+57)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6e+66) or not (b <= 2.3e+57): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6e+66) || !(b <= 2.3e+57)) 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 <= -6e+66) || ~((b <= 2.3e+57))) 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, -6e+66], N[Not[LessEqual[b, 2.3e+57]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{+66} \lor \neg \left(b \leq 2.3 \cdot 10^{+57}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -6.00000000000000005e66 or 2.2999999999999999e57 < b 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--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 73.5%
if -6.00000000000000005e66 < b < 2.2999999999999999e57Initial 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 b around inf 59.0%
associate--l+59.0%
associate-/l*59.0%
Simplified59.0%
Taylor expanded in y around 0 69.7%
associate--l+69.7%
associate-*r/69.7%
Simplified69.7%
Taylor expanded in x around inf 59.9%
Final simplification65.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -5e-145) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -5e-145) {
tmp = x + t_1;
} 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 = b * (a - 0.5d0)
if ((x + y) <= (-5d-145)) then
tmp = x + t_1
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 = b * (a - 0.5);
double tmp;
if ((x + y) <= -5e-145) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= -5e-145: tmp = x + t_1 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -5e-145) tmp = Float64(x + t_1); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -5e-145) tmp = x + t_1; else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -5e-145], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -5 \cdot 10^{-145}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -4.9999999999999998e-145Initial program 99.9%
Taylor expanded in x around inf 73.4%
Taylor expanded in x around inf 60.5%
if -4.9999999999999998e-145 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around inf 84.1%
Taylor expanded in y around inf 59.9%
Final simplification60.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.05e+68) (not (<= b 2.6e+56))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.05e+68) || !(b <= 2.6e+56)) {
tmp = a * b;
} 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 <= (-2.05d+68)) .or. (.not. (b <= 2.6d+56))) then
tmp = a * b
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 <= -2.05e+68) || !(b <= 2.6e+56)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.05e+68) or not (b <= 2.6e+56): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.05e+68) || !(b <= 2.6e+56)) tmp = Float64(a * b); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2.05e+68) || ~((b <= 2.6e+56))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.05e+68], N[Not[LessEqual[b, 2.6e+56]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.05 \cdot 10^{+68} \lor \neg \left(b \leq 2.6 \cdot 10^{+56}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -2.05e68 or 2.60000000000000011e56 < b 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--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 47.0%
*-commutative47.0%
Simplified47.0%
if -2.05e68 < b < 2.60000000000000011e56Initial 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 b around inf 59.0%
associate--l+59.0%
associate-/l*59.0%
Simplified59.0%
Taylor expanded in y around 0 69.7%
associate--l+69.7%
associate-*r/69.7%
Simplified69.7%
Taylor expanded in x around inf 59.9%
Final simplification54.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1350000000000.0) (+ x (* b (- a 0.5))) (+ y (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1350000000000.0) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (a * b);
}
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 <= 1350000000000.0d0) then
tmp = x + (b * (a - 0.5d0))
else
tmp = y + (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1350000000000.0) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1350000000000.0: tmp = x + (b * (a - 0.5)) else: tmp = y + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1350000000000.0) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(y + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1350000000000.0) tmp = x + (b * (a - 0.5)); else tmp = y + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1350000000000.0], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1350000000000:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\end{array}
if y < 1.35e12Initial program 99.9%
Taylor expanded in x around inf 79.4%
Taylor expanded in x around inf 65.4%
if 1.35e12 < y 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 b around inf 66.9%
associate--l+66.9%
associate-/l*66.9%
Simplified66.9%
Taylor expanded in y around 0 84.2%
associate--l+84.2%
associate-*r/84.2%
Simplified84.2%
Taylor expanded in a around inf 73.5%
*-commutative73.5%
Simplified73.5%
Final simplification67.1%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (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 = (x + y) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return (x + y) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Taylor expanded in z around 0 80.4%
Final simplification80.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.05e-23) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.05e-23) {
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 (y <= 2.05d-23) 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 (y <= 2.05e-23) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.05e-23: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.05e-23) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.05e-23) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.05e-23], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.05 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.05000000000000015e-23Initial 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 24.3%
if 2.05000000000000015e-23 < y 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 y around inf 50.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 20.8%
(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 2024086
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))