
(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 (fma (+ a -0.5) b (+ x (+ y (- z (* z (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a + -0.5), b, (x + (y + (z - (z * log(t))))));
}
function code(x, y, z, t, a, b) return fma(Float64(a + -0.5), b, Float64(x + Float64(y + Float64(z - Float64(z * log(t)))))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + N[(y + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, x + \left(y + \left(z - z \cdot \log t\right)\right)\right)
\end{array}
Initial program 99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -3.8e-66)
(+ y (- (+ x z) (* b (- 0.5 a))))
(if (<= b 5.5e+72)
(+ (+ (- z (* z (log t))) (+ x y)) (* -0.5 b))
(+ (+ x y) (* b (- a 0.5))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.8e-66) {
tmp = y + ((x + z) - (b * (0.5 - a)));
} else if (b <= 5.5e+72) {
tmp = ((z - (z * log(t))) + (x + y)) + (-0.5 * b);
} 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 (b <= (-3.8d-66)) then
tmp = y + ((x + z) - (b * (0.5d0 - a)))
else if (b <= 5.5d+72) then
tmp = ((z - (z * log(t))) + (x + y)) + ((-0.5d0) * b)
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 (b <= -3.8e-66) {
tmp = y + ((x + z) - (b * (0.5 - a)));
} else if (b <= 5.5e+72) {
tmp = ((z - (z * Math.log(t))) + (x + y)) + (-0.5 * b);
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -3.8e-66: tmp = y + ((x + z) - (b * (0.5 - a))) elif b <= 5.5e+72: tmp = ((z - (z * math.log(t))) + (x + y)) + (-0.5 * b) else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.8e-66) tmp = Float64(y + Float64(Float64(x + z) - Float64(b * Float64(0.5 - a)))); elseif (b <= 5.5e+72) tmp = Float64(Float64(Float64(z - Float64(z * log(t))) + Float64(x + y)) + Float64(-0.5 * b)); 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 (b <= -3.8e-66) tmp = y + ((x + z) - (b * (0.5 - a))); elseif (b <= 5.5e+72) tmp = ((z - (z * log(t))) + (x + y)) + (-0.5 * b); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.8e-66], N[(y + N[(N[(x + z), $MachinePrecision] - N[(b * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.5e+72], N[(N[(N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{-66}:\\
\;\;\;\;y + \left(\left(x + z\right) - b \cdot \left(0.5 - a\right)\right)\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{+72}:\\
\;\;\;\;\left(\left(z - z \cdot \log t\right) + \left(x + y\right)\right) + -0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if b < -3.7999999999999998e-66Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 89.0%
if -3.7999999999999998e-66 < b < 5.5e72Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in a around 0 92.5%
*-commutative92.5%
Simplified92.5%
if 5.5e72 < b Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 91.1%
Final simplification91.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= (+ x y) -1e-13)
(+ y (+ (+ x z) 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) <= -1e-13) {
tmp = y + ((x + z) + 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) <= (-1d-13)) then
tmp = y + ((x + z) + 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) <= -1e-13) {
tmp = y + ((x + z) + 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) <= -1e-13: tmp = y + ((x + z) + 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) <= -1e-13) tmp = Float64(y + Float64(Float64(x + z) + t_1)); else tmp = Float64(Float64(Float64(y + 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) <= -1e-13) tmp = y + ((x + z) + 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], -1e-13], N[(y + N[(N[(x + z), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y + z), $MachinePrecision] + 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}\;x + y \leq -1 \cdot 10^{-13}:\\
\;\;\;\;y + \left(\left(x + z\right) + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y + z\right) + t_1\right) - z \cdot \log t\\
\end{array}
\end{array}
if (+.f64 x y) < -1e-13Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 88.2%
if -1e-13 < (+.f64 x y) Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 81.5%
associate-+r+81.5%
+-commutative81.5%
Simplified81.5%
Final simplification83.9%
(FPCore (x y z t a b) :precision binary64 (+ (+ (- z (* z (log t))) (+ x y)) (* (+ a -0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((z - (z * log(t))) + (x + y)) + ((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 = ((z - (z * log(t))) + (x + y)) + ((a + (-0.5d0)) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((z - (z * Math.log(t))) + (x + y)) + ((a + -0.5) * b);
}
def code(x, y, z, t, a, b): return ((z - (z * math.log(t))) + (x + y)) + ((a + -0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z - Float64(z * log(t))) + Float64(x + y)) + Float64(Float64(a + -0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((z - (z * log(t))) + (x + y)) + ((a + -0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z - z \cdot \log t\right) + \left(x + y\right)\right) + \left(a + -0.5\right) \cdot b
\end{array}
Initial program 99.8%
remove-double-neg99.8%
distribute-rgt-neg-out99.8%
associate--l+99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
remove-double-neg99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -7.8e-66)
(+ y (- (+ x z) (* b (- 0.5 a))))
(if (<= b 1.2e-33)
(+ x (- (+ y z) (* z (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 (b <= -7.8e-66) {
tmp = y + ((x + z) - (b * (0.5 - a)));
} else if (b <= 1.2e-33) {
tmp = x + ((y + z) - (z * 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 (b <= (-7.8d-66)) then
tmp = y + ((x + z) - (b * (0.5d0 - a)))
else if (b <= 1.2d-33) then
tmp = x + ((y + z) - (z * 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 (b <= -7.8e-66) {
tmp = y + ((x + z) - (b * (0.5 - a)));
} else if (b <= 1.2e-33) {
tmp = x + ((y + z) - (z * Math.log(t)));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -7.8e-66: tmp = y + ((x + z) - (b * (0.5 - a))) elif b <= 1.2e-33: tmp = x + ((y + z) - (z * 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 (b <= -7.8e-66) tmp = Float64(y + Float64(Float64(x + z) - Float64(b * Float64(0.5 - a)))); elseif (b <= 1.2e-33) tmp = Float64(x + Float64(Float64(y + z) - Float64(z * 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 (b <= -7.8e-66) tmp = y + ((x + z) - (b * (0.5 - a))); elseif (b <= 1.2e-33) tmp = x + ((y + z) - (z * log(t))); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -7.8e-66], N[(y + N[(N[(x + z), $MachinePrecision] - N[(b * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.2e-33], N[(x + N[(N[(y + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $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}\;b \leq -7.8 \cdot 10^{-66}:\\
\;\;\;\;y + \left(\left(x + z\right) - b \cdot \left(0.5 - a\right)\right)\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{-33}:\\
\;\;\;\;x + \left(\left(y + z\right) - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if b < -7.79999999999999965e-66Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 89.0%
if -7.79999999999999965e-66 < b < 1.2e-33Initial program 99.7%
associate-+l-99.7%
+-commutative99.7%
associate-+l+99.7%
associate--l+99.7%
fma-neg99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in b around 0 94.2%
associate--l+94.2%
+-commutative94.2%
Simplified94.2%
if 1.2e-33 < b Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 87.8%
Final simplification90.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.35e+186) (not (<= z 4e+155))) (+ y (* z (- 1.0 (log t)))) (+ y (+ (+ x z) (* b (- a 0.5))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.35e+186) || !(z <= 4e+155)) {
tmp = y + (z * (1.0 - log(t)));
} else {
tmp = y + ((x + z) + (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.35d+186)) .or. (.not. (z <= 4d+155))) then
tmp = y + (z * (1.0d0 - log(t)))
else
tmp = y + ((x + z) + (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.35e+186) || !(z <= 4e+155)) {
tmp = y + (z * (1.0 - Math.log(t)));
} else {
tmp = y + ((x + z) + (b * (a - 0.5)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.35e+186) or not (z <= 4e+155): tmp = y + (z * (1.0 - math.log(t))) else: tmp = y + ((x + z) + (b * (a - 0.5))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.35e+186) || !(z <= 4e+155)) tmp = Float64(y + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(y + Float64(Float64(x + z) + 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.35e+186) || ~((z <= 4e+155))) tmp = y + (z * (1.0 - log(t))); else tmp = y + ((x + z) + (b * (a - 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.35e+186], N[Not[LessEqual[z, 4e+155]], $MachinePrecision]], N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[(x + z), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+186} \lor \neg \left(z \leq 4 \cdot 10^{+155}\right):\\
\;\;\;\;y + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;y + \left(\left(x + z\right) + b \cdot \left(a - 0.5\right)\right)\\
\end{array}
\end{array}
if z < -1.3499999999999999e186 or 4.00000000000000003e155 < z Initial program 99.6%
associate-+l-99.6%
+-commutative99.6%
associate-+l+99.6%
associate--l+99.6%
fma-neg99.6%
distribute-lft-neg-in99.6%
*-commutative99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in z around inf 64.4%
if -1.3499999999999999e186 < z < 4.00000000000000003e155Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 89.7%
Final simplification84.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.7e+190) (not (<= z 7.8e+155))) (* z (- 1.0 (log t))) (+ y (+ (+ x z) (* b (- a 0.5))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.7e+190) || !(z <= 7.8e+155)) {
tmp = z * (1.0 - log(t));
} else {
tmp = y + ((x + z) + (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.7d+190)) .or. (.not. (z <= 7.8d+155))) then
tmp = z * (1.0d0 - log(t))
else
tmp = y + ((x + z) + (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.7e+190) || !(z <= 7.8e+155)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = y + ((x + z) + (b * (a - 0.5)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.7e+190) or not (z <= 7.8e+155): tmp = z * (1.0 - math.log(t)) else: tmp = y + ((x + z) + (b * (a - 0.5))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.7e+190) || !(z <= 7.8e+155)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(y + Float64(Float64(x + z) + 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.7e+190) || ~((z <= 7.8e+155))) tmp = z * (1.0 - log(t)); else tmp = y + ((x + z) + (b * (a - 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.7e+190], N[Not[LessEqual[z, 7.8e+155]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[(x + z), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+190} \lor \neg \left(z \leq 7.8 \cdot 10^{+155}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;y + \left(\left(x + z\right) + b \cdot \left(a - 0.5\right)\right)\\
\end{array}
\end{array}
if z < -1.7e190 or 7.7999999999999996e155 < z Initial program 99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 97.5%
Taylor expanded in x around 0 89.6%
Taylor expanded in z around inf 62.2%
if -1.7e190 < z < 7.7999999999999996e155Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 89.7%
Final simplification84.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.65e-102)
x
(if (<= y -6.5e-134)
(* a b)
(if (<= y -8.8e-219) x (if (<= y 1.3e+94) (* a b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.65e-102) {
tmp = x;
} else if (y <= -6.5e-134) {
tmp = a * b;
} else if (y <= -8.8e-219) {
tmp = x;
} else if (y <= 1.3e+94) {
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 <= (-1.65d-102)) then
tmp = x
else if (y <= (-6.5d-134)) then
tmp = a * b
else if (y <= (-8.8d-219)) then
tmp = x
else if (y <= 1.3d+94) 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 <= -1.65e-102) {
tmp = x;
} else if (y <= -6.5e-134) {
tmp = a * b;
} else if (y <= -8.8e-219) {
tmp = x;
} else if (y <= 1.3e+94) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.65e-102: tmp = x elif y <= -6.5e-134: tmp = a * b elif y <= -8.8e-219: tmp = x elif y <= 1.3e+94: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.65e-102) tmp = x; elseif (y <= -6.5e-134) tmp = Float64(a * b); elseif (y <= -8.8e-219) tmp = x; elseif (y <= 1.3e+94) 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 <= -1.65e-102) tmp = x; elseif (y <= -6.5e-134) tmp = a * b; elseif (y <= -8.8e-219) tmp = x; elseif (y <= 1.3e+94) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.65e-102], x, If[LessEqual[y, -6.5e-134], N[(a * b), $MachinePrecision], If[LessEqual[y, -8.8e-219], x, If[LessEqual[y, 1.3e+94], N[(a * b), $MachinePrecision], y]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-102}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-134}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-219}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+94}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.65e-102 or -6.4999999999999998e-134 < y < -8.7999999999999998e-219Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in y around 0 74.9%
Taylor expanded in z around 0 56.3%
Taylor expanded in x around inf 26.7%
if -1.65e-102 < y < -6.4999999999999998e-134 or -8.7999999999999998e-219 < y < 1.3e94Initial program 99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 94.8%
Taylor expanded in a around inf 32.9%
*-commutative32.9%
Simplified32.9%
if 1.3e94 < y Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 42.4%
Final simplification32.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= b -5.6e+194)
t_1
(if (<= b -7.2e+49) (+ y (* a b)) (if (<= b 2.2e+88) (+ x 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 (b <= -5.6e+194) {
tmp = t_1;
} else if (b <= -7.2e+49) {
tmp = y + (a * b);
} else if (b <= 2.2e+88) {
tmp = x + y;
} else {
tmp = 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 (b <= (-5.6d+194)) then
tmp = t_1
else if (b <= (-7.2d+49)) then
tmp = y + (a * b)
else if (b <= 2.2d+88) then
tmp = x + y
else
tmp = 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 (b <= -5.6e+194) {
tmp = t_1;
} else if (b <= -7.2e+49) {
tmp = y + (a * b);
} else if (b <= 2.2e+88) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if b <= -5.6e+194: tmp = t_1 elif b <= -7.2e+49: tmp = y + (a * b) elif b <= 2.2e+88: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (b <= -5.6e+194) tmp = t_1; elseif (b <= -7.2e+49) tmp = Float64(y + Float64(a * b)); elseif (b <= 2.2e+88) tmp = Float64(x + y); else tmp = 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 (b <= -5.6e+194) tmp = t_1; elseif (b <= -7.2e+49) tmp = y + (a * b); elseif (b <= 2.2e+88) tmp = x + y; else tmp = 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[b, -5.6e+194], t$95$1, If[LessEqual[b, -7.2e+49], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.2e+88], N[(x + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;b \leq -5.6 \cdot 10^{+194}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -7.2 \cdot 10^{+49}:\\
\;\;\;\;y + a \cdot b\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{+88}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -5.60000000000000021e194 or 2.20000000000000009e88 < b Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in y around 0 97.3%
Taylor expanded in b around inf 84.4%
if -5.60000000000000021e194 < b < -7.19999999999999993e49Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in a around inf 74.5%
*-commutative74.5%
Simplified74.5%
if -7.19999999999999993e49 < b < 2.20000000000000009e88Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around inf 58.6%
Final simplification67.6%
(FPCore (x y z t a b) :precision binary64 (+ y (+ (+ x z) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
return y + ((x + z) + (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 = y + ((x + z) + (b * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return y + ((x + z) + (b * (a - 0.5)));
}
def code(x, y, z, t, a, b): return y + ((x + z) + (b * (a - 0.5)))
function code(x, y, z, t, a, b) return Float64(y + Float64(Float64(x + z) + Float64(b * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a, b) tmp = y + ((x + z) + (b * (a - 0.5))); end
code[x_, y_, z_, t_, a_, b_] := N[(y + N[(N[(x + z), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + \left(\left(x + z\right) + b \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in z around 0 79.0%
Final simplification79.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.75e+50) (not (<= b 1.15e+88))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.75e+50) || !(b <= 1.15e+88)) {
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 <= (-1.75d+50)) .or. (.not. (b <= 1.15d+88))) 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 <= -1.75e+50) || !(b <= 1.15e+88)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.75e+50) or not (b <= 1.15e+88): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.75e+50) || !(b <= 1.15e+88)) 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 <= -1.75e+50) || ~((b <= 1.15e+88))) 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, -1.75e+50], N[Not[LessEqual[b, 1.15e+88]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.75 \cdot 10^{+50} \lor \neg \left(b \leq 1.15 \cdot 10^{+88}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -1.75000000000000003e50 or 1.1500000000000001e88 < b Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in y around 0 92.3%
Taylor expanded in b around inf 75.6%
if -1.75000000000000003e50 < b < 1.1500000000000001e88Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around inf 58.6%
Final simplification65.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y 3.9e+92) (- x (* b (- 0.5 a))) (+ y (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 3.9e+92) {
tmp = x - (b * (0.5 - a));
} 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 <= 3.9d+92) then
tmp = x - (b * (0.5d0 - a))
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 <= 3.9e+92) {
tmp = x - (b * (0.5 - a));
} else {
tmp = y + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 3.9e+92: tmp = x - (b * (0.5 - a)) else: tmp = y + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 3.9e+92) tmp = Float64(x - Float64(b * Float64(0.5 - a))); 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 <= 3.9e+92) tmp = x - (b * (0.5 - a)); else tmp = y + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 3.9e+92], N[(x - N[(b * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{+92}:\\
\;\;\;\;x - b \cdot \left(0.5 - a\right)\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\end{array}
if y < 3.90000000000000011e92Initial program 99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 86.1%
Taylor expanded in z around 0 63.7%
if 3.90000000000000011e92 < y Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate-+l+99.9%
associate--l+99.9%
fma-neg99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in a around inf 63.2%
*-commutative63.2%
Simplified63.2%
Final simplification63.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.15e-69) (- x (* b (- 0.5 a))) (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.15e-69) {
tmp = x - (b * (0.5 - a));
} 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.15d-69)) then
tmp = x - (b * (0.5d0 - a))
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.15e-69) {
tmp = x - (b * (0.5 - a));
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.15e-69: tmp = x - (b * (0.5 - a)) else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.15e-69) tmp = Float64(x - Float64(b * Float64(0.5 - a))); 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.15e-69) tmp = x - (b * (0.5 - a)); else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.15e-69], N[(x - N[(b * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-69}:\\
\;\;\;\;x - b \cdot \left(0.5 - a\right)\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if x < -1.15e-69Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in y around 0 86.5%
Taylor expanded in z around 0 73.0%
if -1.15e-69 < x Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in b around inf 58.5%
Final simplification63.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.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in z around 0 78.4%
Final simplification78.4%
(FPCore (x y z t a b) :precision binary64 (if (<= a -6e+63) (* a b) (if (<= a 320.0) (+ x y) (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6e+63) {
tmp = a * b;
} else if (a <= 320.0) {
tmp = x + y;
} else {
tmp = 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 (a <= (-6d+63)) then
tmp = a * b
else if (a <= 320.0d0) then
tmp = x + y
else
tmp = 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 (a <= -6e+63) {
tmp = a * b;
} else if (a <= 320.0) {
tmp = x + y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6e+63: tmp = a * b elif a <= 320.0: tmp = x + y else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6e+63) tmp = Float64(a * b); elseif (a <= 320.0) tmp = Float64(x + y); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6e+63) tmp = a * b; elseif (a <= 320.0) tmp = x + y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6e+63], N[(a * b), $MachinePrecision], If[LessEqual[a, 320.0], N[(x + y), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+63}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \leq 320:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if a < -5.99999999999999998e63 or 320 < a Initial program 99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 84.3%
Taylor expanded in a around inf 55.5%
*-commutative55.5%
Simplified55.5%
if -5.99999999999999998e63 < a < 320Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around inf 59.0%
Final simplification57.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.15e-69) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.15e-69) {
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.15d-69)) 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.15e-69) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.15e-69: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.15e-69) 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.15e-69) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.15e-69], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-69}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.15e-69Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in y around 0 86.5%
Taylor expanded in z around 0 73.0%
Taylor expanded in x around inf 35.9%
if -1.15e-69 < x Initial program 99.8%
associate-+l-99.8%
+-commutative99.8%
associate-+l+99.8%
associate--l+99.8%
fma-neg99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 23.2%
Final simplification27.5%
(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.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 79.9%
Taylor expanded in z around 0 59.3%
Taylor expanded in x around inf 23.6%
Final simplification23.6%
(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 2023279
(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)))