
(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.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%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5)))
(t_2 (* z (- 1.0 (log t))))
(t_3 (* b (- (+ a (+ (/ x b) (/ y b))) 0.5))))
(if (<= t_1 -1e+106)
t_3
(if (<= t_1 -1e-59) (+ t_2 x) (if (<= t_1 5e+115) (+ t_2 y) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = z * (1.0 - log(t));
double t_3 = b * ((a + ((x / b) + (y / b))) - 0.5);
double tmp;
if (t_1 <= -1e+106) {
tmp = t_3;
} else if (t_1 <= -1e-59) {
tmp = t_2 + x;
} else if (t_1 <= 5e+115) {
tmp = t_2 + y;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = b * (a - 0.5d0)
t_2 = z * (1.0d0 - log(t))
t_3 = b * ((a + ((x / b) + (y / b))) - 0.5d0)
if (t_1 <= (-1d+106)) then
tmp = t_3
else if (t_1 <= (-1d-59)) then
tmp = t_2 + x
else if (t_1 <= 5d+115) then
tmp = t_2 + y
else
tmp = t_3
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 t_2 = z * (1.0 - Math.log(t));
double t_3 = b * ((a + ((x / b) + (y / b))) - 0.5);
double tmp;
if (t_1 <= -1e+106) {
tmp = t_3;
} else if (t_1 <= -1e-59) {
tmp = t_2 + x;
} else if (t_1 <= 5e+115) {
tmp = t_2 + y;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = z * (1.0 - math.log(t)) t_3 = b * ((a + ((x / b) + (y / b))) - 0.5) tmp = 0 if t_1 <= -1e+106: tmp = t_3 elif t_1 <= -1e-59: tmp = t_2 + x elif t_1 <= 5e+115: tmp = t_2 + y else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(z * Float64(1.0 - log(t))) t_3 = Float64(b * Float64(Float64(a + Float64(Float64(x / b) + Float64(y / b))) - 0.5)) tmp = 0.0 if (t_1 <= -1e+106) tmp = t_3; elseif (t_1 <= -1e-59) tmp = Float64(t_2 + x); elseif (t_1 <= 5e+115) tmp = Float64(t_2 + y); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); t_2 = z * (1.0 - log(t)); t_3 = b * ((a + ((x / b) + (y / b))) - 0.5); tmp = 0.0; if (t_1 <= -1e+106) tmp = t_3; elseif (t_1 <= -1e-59) tmp = t_2 + x; elseif (t_1 <= 5e+115) tmp = t_2 + y; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(b * N[(N[(a + N[(N[(x / b), $MachinePrecision] + N[(y / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+106], t$95$3, If[LessEqual[t$95$1, -1e-59], N[(t$95$2 + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+115], N[(t$95$2 + y), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := z \cdot \left(1 - \log t\right)\\
t_3 := b \cdot \left(\left(a + \left(\frac{x}{b} + \frac{y}{b}\right)\right) - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+106}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-59}:\\
\;\;\;\;t\_2 + x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+115}:\\
\;\;\;\;t\_2 + y\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.00000000000000009e106 or 5.00000000000000008e115 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) 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 97.5%
associate-*r*97.5%
mul-1-neg97.5%
mul-1-neg97.5%
unsub-neg97.5%
sub-neg97.5%
metadata-eval97.5%
mul-1-neg97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in z around 0 88.9%
associate-*r*88.9%
mul-1-neg88.9%
+-commutative88.9%
Simplified88.9%
if -1.00000000000000009e106 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e-59Initial program 99.8%
+-commutative99.8%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 73.3%
if -1e-59 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.00000000000000008e115Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
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 61.4%
Final simplification75.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -2e+166) (not (<= t_1 1e+138)))
(* b (- (+ a (+ (/ x b) (/ y b))) 0.5))
(+ (* z (- 1.0 (log t))) (+ x 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 <= -2e+166) || !(t_1 <= 1e+138)) {
tmp = b * ((a + ((x / b) + (y / b))) - 0.5);
} else {
tmp = (z * (1.0 - log(t))) + (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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-2d+166)) .or. (.not. (t_1 <= 1d+138))) then
tmp = b * ((a + ((x / b) + (y / b))) - 0.5d0)
else
tmp = (z * (1.0d0 - log(t))) + (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 t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -2e+166) || !(t_1 <= 1e+138)) {
tmp = b * ((a + ((x / b) + (y / b))) - 0.5);
} else {
tmp = (z * (1.0 - Math.log(t))) + (x + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -2e+166) or not (t_1 <= 1e+138): tmp = b * ((a + ((x / b) + (y / b))) - 0.5) else: tmp = (z * (1.0 - math.log(t))) + (x + 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 <= -2e+166) || !(t_1 <= 1e+138)) tmp = Float64(b * Float64(Float64(a + Float64(Float64(x / b) + Float64(y / b))) - 0.5)); else tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(x + 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 <= -2e+166) || ~((t_1 <= 1e+138))) tmp = b * ((a + ((x / b) + (y / b))) - 0.5); else tmp = (z * (1.0 - log(t))) + (x + 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, -2e+166], N[Not[LessEqual[t$95$1, 1e+138]], $MachinePrecision]], N[(b * N[(N[(a + N[(N[(x / b), $MachinePrecision] + N[(y / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+166} \lor \neg \left(t\_1 \leq 10^{+138}\right):\\
\;\;\;\;b \cdot \left(\left(a + \left(\frac{x}{b} + \frac{y}{b}\right)\right) - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + \left(x + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.99999999999999988e166 or 1e138 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) 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 b around -inf 98.9%
associate-*r*98.9%
mul-1-neg98.9%
mul-1-neg98.9%
unsub-neg98.9%
sub-neg98.9%
metadata-eval98.9%
mul-1-neg98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in z around 0 93.9%
associate-*r*93.9%
mul-1-neg93.9%
+-commutative93.9%
Simplified93.9%
if -1.99999999999999988e166 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1e138Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 88.0%
Final simplification90.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -1e+106) (not (<= t_1 3e+76)))
(* b (- (+ a (+ (/ x b) (/ y b))) 0.5))
(+ (* z (- 1.0 (log t))) x))))
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+106) || !(t_1 <= 3e+76)) {
tmp = b * ((a + ((x / b) + (y / b))) - 0.5);
} else {
tmp = (z * (1.0 - log(t))) + x;
}
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+106)) .or. (.not. (t_1 <= 3d+76))) then
tmp = b * ((a + ((x / b) + (y / b))) - 0.5d0)
else
tmp = (z * (1.0d0 - log(t))) + x
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+106) || !(t_1 <= 3e+76)) {
tmp = b * ((a + ((x / b) + (y / b))) - 0.5);
} else {
tmp = (z * (1.0 - Math.log(t))) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -1e+106) or not (t_1 <= 3e+76): tmp = b * ((a + ((x / b) + (y / b))) - 0.5) else: tmp = (z * (1.0 - math.log(t))) + x 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+106) || !(t_1 <= 3e+76)) tmp = Float64(b * Float64(Float64(a + Float64(Float64(x / b) + Float64(y / b))) - 0.5)); else tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); 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+106) || ~((t_1 <= 3e+76))) tmp = b * ((a + ((x / b) + (y / b))) - 0.5); else tmp = (z * (1.0 - log(t))) + x; 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+106], N[Not[LessEqual[t$95$1, 3e+76]], $MachinePrecision]], N[(b * N[(N[(a + N[(N[(x / b), $MachinePrecision] + N[(y / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+106} \lor \neg \left(t\_1 \leq 3 \cdot 10^{+76}\right):\\
\;\;\;\;b \cdot \left(\left(a + \left(\frac{x}{b} + \frac{y}{b}\right)\right) - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.00000000000000009e106 or 2.9999999999999998e76 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) 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 97.1%
associate-*r*97.1%
mul-1-neg97.1%
mul-1-neg97.1%
unsub-neg97.1%
sub-neg97.1%
metadata-eval97.1%
mul-1-neg97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in z around 0 86.2%
associate-*r*86.2%
mul-1-neg86.2%
+-commutative86.2%
Simplified86.2%
if -1.00000000000000009e106 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.9999999999999998e76Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 71.3%
Final simplification78.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (log t))) (t_2 (* b (- a 0.5)))) (if (<= (+ x y) -5e+18) (+ t_2 (- (+ z x) t_1)) (+ t_2 (- (+ z y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double t_2 = b * (a - 0.5);
double tmp;
if ((x + y) <= -5e+18) {
tmp = t_2 + ((z + x) - t_1);
} else {
tmp = t_2 + ((z + 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) :: t_2
real(8) :: tmp
t_1 = z * log(t)
t_2 = b * (a - 0.5d0)
if ((x + y) <= (-5d+18)) then
tmp = t_2 + ((z + x) - t_1)
else
tmp = t_2 + ((z + y) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * Math.log(t);
double t_2 = b * (a - 0.5);
double tmp;
if ((x + y) <= -5e+18) {
tmp = t_2 + ((z + x) - t_1);
} else {
tmp = t_2 + ((z + y) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = b * (a - 0.5) tmp = 0 if (x + y) <= -5e+18: tmp = t_2 + ((z + x) - t_1) else: tmp = t_2 + ((z + y) - t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -5e+18) tmp = Float64(t_2 + Float64(Float64(z + x) - t_1)); else tmp = Float64(t_2 + Float64(Float64(z + y) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); t_2 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -5e+18) tmp = t_2 + ((z + x) - t_1); else tmp = t_2 + ((z + y) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -5e+18], N[(t$95$2 + N[(N[(z + x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(z + y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -5 \cdot 10^{+18}:\\
\;\;\;\;t\_2 + \left(\left(z + x\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\left(z + y\right) - t\_1\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -5e18Initial program 99.8%
Taylor expanded in y around 0 77.8%
+-commutative77.8%
Simplified77.8%
if -5e18 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 81.9%
+-commutative81.9%
Simplified81.9%
Final simplification80.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 1e+154) (+ t_1 (- (+ z x) (* z (log t)))) (+ t_1 (+ z 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+154) {
tmp = t_1 + ((z + x) - (z * log(t)));
} else {
tmp = t_1 + (z + 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+154) then
tmp = t_1 + ((z + x) - (z * log(t)))
else
tmp = t_1 + (z + 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+154) {
tmp = t_1 + ((z + x) - (z * Math.log(t)));
} else {
tmp = t_1 + (z + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= 1e+154: tmp = t_1 + ((z + x) - (z * math.log(t))) else: tmp = t_1 + (z + 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+154) tmp = Float64(t_1 + Float64(Float64(z + x) - Float64(z * log(t)))); else tmp = Float64(t_1 + Float64(z + 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+154) tmp = t_1 + ((z + x) - (z * log(t))); else tmp = t_1 + (z + 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+154], N[(t$95$1 + N[(N[(z + x), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(z + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq 10^{+154}:\\
\;\;\;\;t\_1 + \left(\left(z + x\right) - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(z + y\right)\\
\end{array}
\end{array}
if (+.f64 x y) < 1.00000000000000004e154Initial program 99.8%
Taylor expanded in y around 0 85.5%
+-commutative85.5%
Simplified85.5%
if 1.00000000000000004e154 < (+.f64 x y) Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 56.9%
Final simplification78.1%
(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.8%
Final simplification99.8%
(FPCore (x y z t a b) :precision binary64 (+ (* b (- a 0.5)) (+ z (- (+ x y) (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (z + ((x + y) - (z * log(t))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (b * (a - 0.5d0)) + (z + ((x + y) - (z * log(t))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (z + ((x + y) - (z * Math.log(t))));
}
def code(x, y, z, t, a, b): return (b * (a - 0.5)) + (z + ((x + y) - (z * math.log(t))))
function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a - 0.5)) + Float64(z + Float64(Float64(x + y) - Float64(z * log(t))))) end
function tmp = code(x, y, z, t, a, b) tmp = (b * (a - 0.5)) + (z + ((x + y) - (z * log(t)))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z + N[(N[(x + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(a - 0.5\right) + \left(z + \left(\left(x + y\right) - z \cdot \log t\right)\right)
\end{array}
Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -2e+166) (not (<= t_1 5e+185)))
(+ t_1 (+ z x))
(+ x (+ y (* -0.5 b))))))
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 <= -2e+166) || !(t_1 <= 5e+185)) {
tmp = t_1 + (z + x);
} else {
tmp = x + (y + (-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 = b * (a - 0.5d0)
if ((t_1 <= (-2d+166)) .or. (.not. (t_1 <= 5d+185))) then
tmp = t_1 + (z + x)
else
tmp = x + (y + ((-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 = b * (a - 0.5);
double tmp;
if ((t_1 <= -2e+166) || !(t_1 <= 5e+185)) {
tmp = t_1 + (z + x);
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -2e+166) or not (t_1 <= 5e+185): tmp = t_1 + (z + x) else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -2e+166) || !(t_1 <= 5e+185)) tmp = Float64(t_1 + Float64(z + x)); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); 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 <= -2e+166) || ~((t_1 <= 5e+185))) tmp = t_1 + (z + x); else tmp = x + (y + (-0.5 * b)); 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, -2e+166], N[Not[LessEqual[t$95$1, 5e+185]], $MachinePrecision]], N[(t$95$1 + N[(z + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+166} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+185}\right):\\
\;\;\;\;t\_1 + \left(z + x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.99999999999999988e166 or 4.9999999999999999e185 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 83.3%
if -1.99999999999999988e166 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.9999999999999999e185Initial program 99.7%
Taylor expanded in a around 0 94.7%
Taylor expanded in z around 0 58.4%
Final simplification66.9%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4.3e+77) (* a b) (if (<= a 1.45e-238) y (if (<= a 1.05e-24) (* -0.5 b) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.3e+77) {
tmp = a * b;
} else if (a <= 1.45e-238) {
tmp = y;
} else if (a <= 1.05e-24) {
tmp = -0.5 * b;
} 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 <= (-4.3d+77)) then
tmp = a * b
else if (a <= 1.45d-238) then
tmp = y
else if (a <= 1.05d-24) then
tmp = (-0.5d0) * b
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 <= -4.3e+77) {
tmp = a * b;
} else if (a <= 1.45e-238) {
tmp = y;
} else if (a <= 1.05e-24) {
tmp = -0.5 * b;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.3e+77: tmp = a * b elif a <= 1.45e-238: tmp = y elif a <= 1.05e-24: tmp = -0.5 * b else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.3e+77) tmp = Float64(a * b); elseif (a <= 1.45e-238) tmp = y; elseif (a <= 1.05e-24) tmp = Float64(-0.5 * b); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4.3e+77) tmp = a * b; elseif (a <= 1.45e-238) tmp = y; elseif (a <= 1.05e-24) tmp = -0.5 * b; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.3e+77], N[(a * b), $MachinePrecision], If[LessEqual[a, 1.45e-238], y, If[LessEqual[a, 1.05e-24], N[(-0.5 * b), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{+77}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{-238}:\\
\;\;\;\;y\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-24}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if a < -4.29999999999999991e77 or 1.05e-24 < a Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
Applied egg-rr99.9%
Taylor expanded in b around inf 47.4%
Taylor expanded in a around inf 47.2%
if -4.29999999999999991e77 < a < 1.4499999999999999e-238Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 57.1%
Taylor expanded in z around 0 28.9%
if 1.4499999999999999e-238 < a < 1.05e-24Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
Applied egg-rr99.8%
Taylor expanded in b around inf 31.7%
Taylor expanded in a around 0 31.7%
Final simplification38.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.46e+23) (not (<= a 3.1e+14))) (+ (+ z x) (* a b)) (+ x (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.46e+23) || !(a <= 3.1e+14)) {
tmp = (z + x) + (a * b);
} else {
tmp = x + (y + (-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) :: tmp
if ((a <= (-1.46d+23)) .or. (.not. (a <= 3.1d+14))) then
tmp = (z + x) + (a * b)
else
tmp = x + (y + ((-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 tmp;
if ((a <= -1.46e+23) || !(a <= 3.1e+14)) {
tmp = (z + x) + (a * b);
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.46e+23) or not (a <= 3.1e+14): tmp = (z + x) + (a * b) else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.46e+23) || !(a <= 3.1e+14)) tmp = Float64(Float64(z + x) + Float64(a * b)); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.46e+23) || ~((a <= 3.1e+14))) tmp = (z + x) + (a * b); else tmp = x + (y + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.46e+23], N[Not[LessEqual[a, 3.1e+14]], $MachinePrecision]], N[(N[(z + x), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.46 \cdot 10^{+23} \lor \neg \left(a \leq 3.1 \cdot 10^{+14}\right):\\
\;\;\;\;\left(z + x\right) + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if a < -1.45999999999999996e23 or 3.1e14 < a Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 68.4%
Taylor expanded in a around inf 68.4%
if -1.45999999999999996e23 < a < 3.1e14Initial program 99.8%
Taylor expanded in a around 0 98.9%
Taylor expanded in z around 0 66.3%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.9e+158) (not (<= a 1.7e+16))) (* a b) (+ x (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.9e+158) || !(a <= 1.7e+16)) {
tmp = a * b;
} else {
tmp = x + (y + (-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) :: tmp
if ((a <= (-2.9d+158)) .or. (.not. (a <= 1.7d+16))) then
tmp = a * b
else
tmp = x + (y + ((-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 tmp;
if ((a <= -2.9e+158) || !(a <= 1.7e+16)) {
tmp = a * b;
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.9e+158) or not (a <= 1.7e+16): tmp = a * b else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.9e+158) || !(a <= 1.7e+16)) tmp = Float64(a * b); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.9e+158) || ~((a <= 1.7e+16))) tmp = a * b; else tmp = x + (y + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.9e+158], N[Not[LessEqual[a, 1.7e+16]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{+158} \lor \neg \left(a \leq 1.7 \cdot 10^{+16}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if a < -2.90000000000000024e158 or 1.7e16 < a Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
Applied egg-rr99.9%
Taylor expanded in b around inf 54.4%
Taylor expanded in a around inf 54.4%
if -2.90000000000000024e158 < a < 1.7e16Initial program 99.8%
Taylor expanded in a around 0 94.5%
Taylor expanded in z around 0 63.7%
Final simplification60.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.65e+77) (not (<= a 1.7e+16))) (* a b) (+ y (* -0.5 b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.65e+77) || !(a <= 1.7e+16)) {
tmp = a * b;
} else {
tmp = y + (-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) :: tmp
if ((a <= (-1.65d+77)) .or. (.not. (a <= 1.7d+16))) then
tmp = a * b
else
tmp = y + ((-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 tmp;
if ((a <= -1.65e+77) || !(a <= 1.7e+16)) {
tmp = a * b;
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.65e+77) or not (a <= 1.7e+16): tmp = a * b else: tmp = y + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.65e+77) || !(a <= 1.7e+16)) tmp = Float64(a * b); else tmp = Float64(y + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.65e+77) || ~((a <= 1.7e+16))) tmp = a * b; else tmp = y + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.65e+77], N[Not[LessEqual[a, 1.7e+16]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.65 \cdot 10^{+77} \lor \neg \left(a \leq 1.7 \cdot 10^{+16}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\end{array}
if a < -1.6499999999999999e77 or 1.7e16 < a Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
Applied egg-rr99.9%
Taylor expanded in b around inf 50.2%
Taylor expanded in a around inf 50.2%
if -1.6499999999999999e77 < a < 1.7e16Initial program 99.8%
Taylor expanded in a around 0 97.2%
Taylor expanded in z around -inf 77.4%
associate-*r*77.4%
neg-mul-177.4%
mul-1-neg77.4%
neg-mul-177.4%
sub-neg77.4%
Simplified77.4%
Taylor expanded in x around 0 63.0%
mul-1-neg63.0%
*-commutative63.0%
distribute-rgt-neg-in63.0%
Simplified63.0%
Taylor expanded in z around 0 42.5%
Final simplification45.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= y 1.28e+26) (+ t_1 (+ z x)) (+ t_1 (+ z 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 (y <= 1.28e+26) {
tmp = t_1 + (z + x);
} else {
tmp = t_1 + (z + 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 (y <= 1.28d+26) then
tmp = t_1 + (z + x)
else
tmp = t_1 + (z + 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 (y <= 1.28e+26) {
tmp = t_1 + (z + x);
} else {
tmp = t_1 + (z + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if y <= 1.28e+26: tmp = t_1 + (z + x) else: tmp = t_1 + (z + y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (y <= 1.28e+26) tmp = Float64(t_1 + Float64(z + x)); else tmp = Float64(t_1 + Float64(z + 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 (y <= 1.28e+26) tmp = t_1 + (z + x); else tmp = t_1 + (z + 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[y, 1.28e+26], N[(t$95$1 + N[(z + x), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(z + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;y \leq 1.28 \cdot 10^{+26}:\\
\;\;\;\;t\_1 + \left(z + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(z + y\right)\\
\end{array}
\end{array}
if y < 1.28e26Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 60.2%
if 1.28e26 < y Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 70.1%
Final simplification62.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 5.8e+172) (* b (- a 0.5)) y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 5.8e+172) {
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 (y <= 5.8d+172) 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 (y <= 5.8e+172) {
tmp = b * (a - 0.5);
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 5.8e+172: tmp = b * (a - 0.5) else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 5.8e+172) 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 (y <= 5.8e+172) tmp = b * (a - 0.5); else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 5.8e+172], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.8 \cdot 10^{+172}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 5.7999999999999999e172Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
Applied egg-rr99.8%
Taylor expanded in b around inf 36.6%
if 5.7999999999999999e172 < y Initial program 99.8%
+-commutative99.8%
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 y around inf 62.3%
Taylor expanded in z around 0 53.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y 9.5e+50) (* -0.5 b) y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 9.5e+50) {
tmp = -0.5 * 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 <= 9.5d+50) then
tmp = (-0.5d0) * 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 <= 9.5e+50) {
tmp = -0.5 * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 9.5e+50: tmp = -0.5 * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 9.5e+50) tmp = Float64(-0.5 * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 9.5e+50) tmp = -0.5 * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 9.5e+50], N[(-0.5 * b), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{+50}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 9.4999999999999993e50Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
Applied egg-rr99.8%
Taylor expanded in b around inf 37.0%
Taylor expanded in a around 0 16.2%
if 9.4999999999999993e50 < 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-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 52.8%
Taylor expanded in z around 0 37.3%
Final simplification21.4%
(FPCore (x y z t a b) :precision binary64 y)
double code(double x, double y, double z, double t, double a, double b) {
return y;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return y;
}
def code(x, y, z, t, a, b): return y
function code(x, y, z, t, a, b) return y end
function tmp = code(x, y, z, t, a, b) tmp = y; end
code[x_, y_, z_, t_, a_, b_] := y
\begin{array}{l}
\\
y
\end{array}
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.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 41.8%
Taylor expanded in z around 0 17.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 2024172
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))