
(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 16 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -3.3e+102)
(+ x (+ t_1 y))
(if (<= z 2.25e+89)
(+ (+ x y) (* b (- a 0.5)))
(+ t_1 (* (+ a -0.5) b))))))
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 <= -3.3e+102) {
tmp = x + (t_1 + y);
} else if (z <= 2.25e+89) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1 + ((a + -0.5) * 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) :: t_1
real(8) :: tmp
t_1 = z * (1.0d0 - log(t))
if (z <= (-3.3d+102)) then
tmp = x + (t_1 + y)
else if (z <= 2.25d+89) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = t_1 + ((a + (-0.5d0)) * b)
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 <= -3.3e+102) {
tmp = x + (t_1 + y);
} else if (z <= 2.25e+89) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1 + ((a + -0.5) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -3.3e+102: tmp = x + (t_1 + y) elif z <= 2.25e+89: tmp = (x + y) + (b * (a - 0.5)) else: tmp = t_1 + ((a + -0.5) * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -3.3e+102) tmp = Float64(x + Float64(t_1 + y)); elseif (z <= 2.25e+89) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(t_1 + Float64(Float64(a + -0.5) * b)); 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 <= -3.3e+102) tmp = x + (t_1 + y); elseif (z <= 2.25e+89) tmp = (x + y) + (b * (a - 0.5)); else tmp = t_1 + ((a + -0.5) * b); 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, -3.3e+102], N[(x + N[(t$95$1 + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+89], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+102}:\\
\;\;\;\;x + \left(t_1 + y\right)\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+89}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(a + -0.5\right) \cdot b\\
\end{array}
\end{array}
if z < -3.29999999999999999e102Initial 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-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 81.3%
if -3.29999999999999999e102 < z < 2.25e89Initial program 100.0%
Taylor expanded in z around 0 95.2%
if 2.25e89 < z Initial program 99.8%
Taylor expanded in x around 0 92.6%
Taylor expanded in y around 0 81.2%
sub-neg81.2%
+-commutative81.2%
*-commutative81.2%
associate-+l+81.2%
sub-neg81.2%
*-commutative81.2%
*-un-lft-identity81.2%
distribute-rgt-out--81.2%
sub-neg81.2%
metadata-eval81.2%
Applied egg-rr81.2%
Final simplification89.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= z -8e+102)
(+ x (+ (* z (- 1.0 (log t))) y))
(if (<= z 7.5e+87) (+ (+ x y) t_1) (- (+ 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 (z <= -8e+102) {
tmp = x + ((z * (1.0 - log(t))) + y);
} else if (z <= 7.5e+87) {
tmp = (x + y) + t_1;
} else {
tmp = (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 (z <= (-8d+102)) then
tmp = x + ((z * (1.0d0 - log(t))) + y)
else if (z <= 7.5d+87) then
tmp = (x + y) + t_1
else
tmp = (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 (z <= -8e+102) {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
} else if (z <= 7.5e+87) {
tmp = (x + y) + t_1;
} else {
tmp = (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 z <= -8e+102: tmp = x + ((z * (1.0 - math.log(t))) + y) elif z <= 7.5e+87: tmp = (x + y) + t_1 else: tmp = (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 (z <= -8e+102) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); elseif (z <= 7.5e+87) tmp = Float64(Float64(x + y) + t_1); else tmp = Float64(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 (z <= -8e+102) tmp = x + ((z * (1.0 - log(t))) + y); elseif (z <= 7.5e+87) tmp = (x + y) + t_1; else tmp = (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[z, -8e+102], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+87], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(z + t$95$1), $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}\;z \leq -8 \cdot 10^{+102}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+87}:\\
\;\;\;\;\left(x + y\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(z + t_1\right) - z \cdot \log t\\
\end{array}
\end{array}
if z < -7.99999999999999982e102Initial 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-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 81.3%
if -7.99999999999999982e102 < z < 7.50000000000000014e87Initial program 100.0%
Taylor expanded in z around 0 95.2%
if 7.50000000000000014e87 < z Initial program 99.8%
Taylor expanded in x around 0 92.6%
Taylor expanded in y around 0 81.2%
Final simplification89.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= (+ x y) -1e+108)
(+ (+ x y) t_1)
(+ t_1 (+ (* 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 ((x + y) <= -1e+108) {
tmp = (x + y) + t_1;
} else {
tmp = t_1 + ((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 ((x + y) <= (-1d+108)) then
tmp = (x + y) + t_1
else
tmp = t_1 + ((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 ((x + y) <= -1e+108) {
tmp = (x + y) + t_1;
} else {
tmp = t_1 + ((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 (x + y) <= -1e+108: tmp = (x + y) + t_1 else: tmp = t_1 + ((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 (Float64(x + y) <= -1e+108) tmp = Float64(Float64(x + y) + t_1); else tmp = Float64(t_1 + 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 ((x + y) <= -1e+108) tmp = (x + y) + t_1; else tmp = t_1 + ((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[LessEqual[N[(x + y), $MachinePrecision], -1e+108], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + 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}\;x + y \leq -1 \cdot 10^{+108}:\\
\;\;\;\;\left(x + y\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -1e108Initial program 100.0%
Taylor expanded in z around 0 89.5%
if -1e108 < (+.f64 x y) Initial program 99.8%
add-sqr-sqrt62.9%
pow262.9%
sub-neg62.9%
associate-+l+62.9%
sub-neg62.9%
*-un-lft-identity62.9%
*-commutative62.9%
distribute-rgt-out--62.9%
+-commutative62.9%
Applied egg-rr62.9%
Taylor expanded in x around 0 83.8%
Simplified83.8%
Final simplification85.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.35e+104) (not (<= z 2.7e+43))) (+ x (+ (* z (- 1.0 (log t))) y)) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.35e+104) || !(z <= 2.7e+43)) {
tmp = x + ((z * (1.0 - log(t))) + y);
} 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 <= (-2.35d+104)) .or. (.not. (z <= 2.7d+43))) then
tmp = x + ((z * (1.0d0 - log(t))) + y)
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 <= -2.35e+104) || !(z <= 2.7e+43)) {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.35e+104) or not (z <= 2.7e+43): tmp = x + ((z * (1.0 - math.log(t))) + y) else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.35e+104) || !(z <= 2.7e+43)) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); 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 <= -2.35e+104) || ~((z <= 2.7e+43))) tmp = x + ((z * (1.0 - log(t))) + y); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.35e+104], N[Not[LessEqual[z, 2.7e+43]], $MachinePrecision]], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $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 -2.35 \cdot 10^{+104} \lor \neg \left(z \leq 2.7 \cdot 10^{+43}\right):\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -2.35000000000000008e104 or 2.7000000000000002e43 < 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-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 78.9%
if -2.35000000000000008e104 < z < 2.7000000000000002e43Initial program 100.0%
Taylor expanded in z around 0 96.8%
Final simplification89.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.8e+147) (not (<= z 2.6e+196))) (* 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 <= -2.8e+147) || !(z <= 2.6e+196)) {
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 <= (-2.8d+147)) .or. (.not. (z <= 2.6d+196))) 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 <= -2.8e+147) || !(z <= 2.6e+196)) {
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 <= -2.8e+147) or not (z <= 2.6e+196): 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 <= -2.8e+147) || !(z <= 2.6e+196)) 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 <= -2.8e+147) || ~((z <= 2.6e+196))) 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, -2.8e+147], N[Not[LessEqual[z, 2.6e+196]], $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 -2.8 \cdot 10^{+147} \lor \neg \left(z \leq 2.6 \cdot 10^{+196}\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 < -2.8000000000000001e147 or 2.60000000000000012e196 < z Initial program 99.8%
add-sqr-sqrt48.8%
pow248.8%
sub-neg48.8%
associate-+l+48.8%
sub-neg48.8%
*-un-lft-identity48.8%
*-commutative48.8%
distribute-rgt-out--48.8%
+-commutative48.8%
Applied egg-rr48.8%
Taylor expanded in x around 0 95.1%
Simplified95.1%
Taylor expanded in z around inf 72.4%
if -2.8000000000000001e147 < z < 2.60000000000000012e196Initial program 99.9%
Taylor expanded in z around 0 88.8%
Final simplification85.0%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.95e+147) (* z (- 1.0 (log t))) (if (<= z 1.5e+194) (+ (+ x y) (* b (- a 0.5))) (- z (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.95e+147) {
tmp = z * (1.0 - log(t));
} else if (z <= 1.5e+194) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = z - (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 <= (-1.95d+147)) then
tmp = z * (1.0d0 - log(t))
else if (z <= 1.5d+194) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = z - (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 <= -1.95e+147) {
tmp = z * (1.0 - Math.log(t));
} else if (z <= 1.5e+194) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = z - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.95e+147: tmp = z * (1.0 - math.log(t)) elif z <= 1.5e+194: tmp = (x + y) + (b * (a - 0.5)) else: tmp = z - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.95e+147) tmp = Float64(z * Float64(1.0 - log(t))); elseif (z <= 1.5e+194) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(z - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.95e+147) tmp = z * (1.0 - log(t)); elseif (z <= 1.5e+194) tmp = (x + y) + (b * (a - 0.5)); else tmp = z - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.95e+147], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+194], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+147}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+194}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z - z \cdot \log t\\
\end{array}
\end{array}
if z < -1.95000000000000008e147Initial program 99.8%
add-sqr-sqrt53.2%
pow253.2%
sub-neg53.2%
associate-+l+53.2%
sub-neg53.2%
*-un-lft-identity53.2%
*-commutative53.2%
distribute-rgt-out--53.2%
+-commutative53.2%
Applied egg-rr53.2%
Taylor expanded in x around 0 93.3%
Simplified93.3%
Taylor expanded in z around inf 72.3%
if -1.95000000000000008e147 < z < 1.5000000000000002e194Initial program 99.9%
Taylor expanded in z around 0 88.8%
if 1.5000000000000002e194 < z Initial program 99.8%
Taylor expanded in x around 0 96.9%
Taylor expanded in y around 0 85.0%
Taylor expanded in b around 0 72.5%
Final simplification85.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))))
(if (<= z -1.5e+141)
(- (+ z y) t_1)
(if (<= z 1e+192) (+ (+ x y) (* b (- a 0.5))) (- z 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 (z <= -1.5e+141) {
tmp = (z + y) - t_1;
} else if (z <= 1e+192) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = z - 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 (z <= (-1.5d+141)) then
tmp = (z + y) - t_1
else if (z <= 1d+192) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = z - 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 (z <= -1.5e+141) {
tmp = (z + y) - t_1;
} else if (z <= 1e+192) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = z - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) tmp = 0 if z <= -1.5e+141: tmp = (z + y) - t_1 elif z <= 1e+192: tmp = (x + y) + (b * (a - 0.5)) else: tmp = z - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) tmp = 0.0 if (z <= -1.5e+141) tmp = Float64(Float64(z + y) - t_1); elseif (z <= 1e+192) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(z - 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 (z <= -1.5e+141) tmp = (z + y) - t_1; elseif (z <= 1e+192) tmp = (x + y) + (b * (a - 0.5)); else tmp = z - 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[z, -1.5e+141], N[(N[(z + y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 1e+192], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+141}:\\
\;\;\;\;\left(z + y\right) - t_1\\
\mathbf{elif}\;z \leq 10^{+192}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z - t_1\\
\end{array}
\end{array}
if z < -1.4999999999999999e141Initial program 99.8%
Taylor expanded in x around 0 93.2%
Taylor expanded in b around 0 75.9%
if -1.4999999999999999e141 < z < 1.00000000000000004e192Initial program 99.9%
Taylor expanded in z around 0 88.8%
if 1.00000000000000004e192 < z Initial program 99.8%
Taylor expanded in x around 0 96.9%
Taylor expanded in y around 0 85.0%
Taylor expanded in b around 0 72.5%
Final simplification85.4%
(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 (<= x -1.7e+96)
x
(if (or (<= x 1.15e-262) (and (not (<= x 4.9e-218)) (<= x 1.28e-161)))
(* a b)
y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.7e+96) {
tmp = x;
} else if ((x <= 1.15e-262) || (!(x <= 4.9e-218) && (x <= 1.28e-161))) {
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 (x <= (-1.7d+96)) then
tmp = x
else if ((x <= 1.15d-262) .or. (.not. (x <= 4.9d-218)) .and. (x <= 1.28d-161)) 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 (x <= -1.7e+96) {
tmp = x;
} else if ((x <= 1.15e-262) || (!(x <= 4.9e-218) && (x <= 1.28e-161))) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.7e+96: tmp = x elif (x <= 1.15e-262) or (not (x <= 4.9e-218) and (x <= 1.28e-161)): tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.7e+96) tmp = x; elseif ((x <= 1.15e-262) || (!(x <= 4.9e-218) && (x <= 1.28e-161))) 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 (x <= -1.7e+96) tmp = x; elseif ((x <= 1.15e-262) || (~((x <= 4.9e-218)) && (x <= 1.28e-161))) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.7e+96], x, If[Or[LessEqual[x, 1.15e-262], And[N[Not[LessEqual[x, 4.9e-218]], $MachinePrecision], LessEqual[x, 1.28e-161]]], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+96}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-262} \lor \neg \left(x \leq 4.9 \cdot 10^{-218}\right) \land x \leq 1.28 \cdot 10^{-161}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.7e96Initial 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 47.3%
if -1.7e96 < x < 1.15000000000000005e-262 or 4.89999999999999978e-218 < x < 1.2799999999999999e-161Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 29.8%
*-commutative29.8%
Simplified29.8%
if 1.15000000000000005e-262 < x < 4.89999999999999978e-218 or 1.2799999999999999e-161 < x 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 29.7%
Final simplification32.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.06e+102) x (if (<= x 7.4e-162) (* b (- a 0.5)) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.06e+102) {
tmp = x;
} else if (x <= 7.4e-162) {
tmp = b * (a - 0.5);
} 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.06d+102)) then
tmp = x
else if (x <= 7.4d-162) then
tmp = b * (a - 0.5d0)
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.06e+102) {
tmp = x;
} else if (x <= 7.4e-162) {
tmp = b * (a - 0.5);
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.06e+102: tmp = x elif x <= 7.4e-162: tmp = b * (a - 0.5) else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.06e+102) tmp = x; elseif (x <= 7.4e-162) tmp = Float64(b * Float64(a - 0.5)); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.06e+102) tmp = x; elseif (x <= 7.4e-162) tmp = b * (a - 0.5); else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.06e+102], x, If[LessEqual[x, 7.4e-162], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{+102}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{-162}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.06000000000000001e102Initial 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 47.3%
if -1.06000000000000001e102 < x < 7.4000000000000003e-162Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 40.1%
if 7.4000000000000003e-162 < x 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 26.3%
Final simplification36.4%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -2e-11) (+ (+ x y) (* -0.5 b)) (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -2e-11) {
tmp = (x + y) + (-0.5 * b);
} else {
tmp = 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 ((x + y) <= (-2d-11)) then
tmp = (x + y) + ((-0.5d0) * b)
else
tmp = 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 ((x + y) <= -2e-11) {
tmp = (x + y) + (-0.5 * b);
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -2e-11: tmp = (x + y) + (-0.5 * b) else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -2e-11) tmp = Float64(Float64(x + y) + Float64(-0.5 * b)); else tmp = Float64(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 ((x + y) <= -2e-11) tmp = (x + y) + (-0.5 * b); else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -2e-11], N[(N[(x + y), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -2 \cdot 10^{-11}:\\
\;\;\;\;\left(x + y\right) + -0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -1.99999999999999988e-11Initial program 100.0%
Taylor expanded in z around 0 79.6%
Taylor expanded in a around 0 64.5%
*-commutative64.5%
Simplified64.5%
if -1.99999999999999988e-11 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 83.2%
Taylor expanded in z around 0 55.0%
Final simplification58.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.7e+106) x (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.7e+106) {
tmp = x;
} else {
tmp = 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 (x <= (-1.7d+106)) then
tmp = x
else
tmp = 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 (x <= -1.7e+106) {
tmp = x;
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.7e+106: tmp = x else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.7e+106) tmp = x; else tmp = Float64(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 (x <= -1.7e+106) tmp = x; else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.7e+106], x, N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+106}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if x < -1.69999999999999997e106Initial 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 48.4%
if -1.69999999999999997e106 < x Initial program 99.9%
Taylor expanded in x around 0 86.4%
Taylor expanded in z around 0 59.0%
Final simplification57.4%
(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 74.7%
Final simplification74.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.8e-62) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.8e-62) {
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 <= (-2.8d-62)) 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 <= -2.8e-62) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.8e-62: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.8e-62) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.8e-62) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.8e-62], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-62}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -2.80000000000000002e-62Initial 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--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 32.4%
if -2.80000000000000002e-62 < x 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 26.3%
Final simplification27.9%
(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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 19.9%
Final simplification19.9%
(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 2024019
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ (+ (+ 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)))