
(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.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.5%
metadata-eval99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.4e+197)
(+ (* z (- 1.0 (log t))) x)
(if (or (<= z -1.8e+147) (and (not (<= z -5.5e+105)) (<= z 9.5e+177)))
(+ (+ x y) (* b (- a 0.5)))
(+ y (- z (* z (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.4e+197) {
tmp = (z * (1.0 - log(t))) + x;
} else if ((z <= -1.8e+147) || (!(z <= -5.5e+105) && (z <= 9.5e+177))) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = y + (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 <= (-4.4d+197)) then
tmp = (z * (1.0d0 - log(t))) + x
else if ((z <= (-1.8d+147)) .or. (.not. (z <= (-5.5d+105))) .and. (z <= 9.5d+177)) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = y + (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 <= -4.4e+197) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else if ((z <= -1.8e+147) || (!(z <= -5.5e+105) && (z <= 9.5e+177))) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = y + (z - (z * Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.4e+197: tmp = (z * (1.0 - math.log(t))) + x elif (z <= -1.8e+147) or (not (z <= -5.5e+105) and (z <= 9.5e+177)): tmp = (x + y) + (b * (a - 0.5)) else: tmp = y + (z - (z * math.log(t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.4e+197) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); elseif ((z <= -1.8e+147) || (!(z <= -5.5e+105) && (z <= 9.5e+177))) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(y + 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 <= -4.4e+197) tmp = (z * (1.0 - log(t))) + x; elseif ((z <= -1.8e+147) || (~((z <= -5.5e+105)) && (z <= 9.5e+177))) tmp = (x + y) + (b * (a - 0.5)); else tmp = y + (z - (z * log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.4e+197], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[Or[LessEqual[z, -1.8e+147], And[N[Not[LessEqual[z, -5.5e+105]], $MachinePrecision], LessEqual[z, 9.5e+177]]], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+197}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{+147} \lor \neg \left(z \leq -5.5 \cdot 10^{+105}\right) \land z \leq 9.5 \cdot 10^{+177}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + \left(z - z \cdot \log t\right)\\
\end{array}
\end{array}
if z < -4.39999999999999979e197Initial program 99.6%
add-cube-cbrt98.7%
pow398.8%
Applied egg-rr98.8%
Taylor expanded in y around 0 94.3%
associate-+r+94.3%
sub-neg94.3%
metadata-eval94.3%
Simplified94.3%
Taylor expanded in b around 0 78.3%
associate--l+78.3%
*-rgt-identity78.3%
unsub-neg78.3%
distribute-rgt-neg-in78.3%
distribute-lft-in78.4%
sub-neg78.4%
Simplified78.4%
if -4.39999999999999979e197 < z < -1.8000000000000001e147 or -5.49999999999999979e105 < z < 9.49999999999999996e177Initial program 99.9%
Taylor expanded in z around 0 93.0%
if -1.8000000000000001e147 < z < -5.49999999999999979e105 or 9.49999999999999996e177 < z Initial program 97.3%
Taylor expanded in x around 0 84.1%
Taylor expanded in b around 0 75.2%
associate-+r-75.3%
Simplified75.3%
Final simplification88.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -2e-40) (+ (+ x y) t_1) (+ t_1 (- (+ z y) (* z (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -2e-40) {
tmp = (x + y) + t_1;
} else {
tmp = t_1 + ((z + y) - (z * log(t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= (-2d-40)) then
tmp = (x + y) + t_1
else
tmp = t_1 + ((z + y) - (z * log(t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -2e-40) {
tmp = (x + y) + t_1;
} else {
tmp = t_1 + ((z + y) - (z * Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= -2e-40: tmp = (x + y) + t_1 else: tmp = t_1 + ((z + y) - (z * math.log(t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -2e-40) tmp = Float64(Float64(x + y) + t_1); else tmp = Float64(t_1 + Float64(Float64(z + y) - Float64(z * log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -2e-40) tmp = (x + y) + t_1; else tmp = t_1 + ((z + y) - (z * log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -2e-40], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(N[(z + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -2 \cdot 10^{-40}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(z + y\right) - z \cdot \log t\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -1.9999999999999999e-40Initial program 99.9%
Taylor expanded in z around 0 85.7%
if -1.9999999999999999e-40 < (+.f64 x y) Initial program 99.2%
Taylor expanded in x around 0 83.0%
Final simplification84.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5))) (t_2 (* z (log t)))) (if (<= (+ x y) -8e-52) (- (+ x (+ z t_1)) t_2) (+ t_1 (- (+ z y) t_2)))))
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 * log(t);
double tmp;
if ((x + y) <= -8e-52) {
tmp = (x + (z + t_1)) - t_2;
} else {
tmp = t_1 + ((z + y) - t_2);
}
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 = b * (a - 0.5d0)
t_2 = z * log(t)
if ((x + y) <= (-8d-52)) then
tmp = (x + (z + t_1)) - t_2
else
tmp = t_1 + ((z + y) - t_2)
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 * Math.log(t);
double tmp;
if ((x + y) <= -8e-52) {
tmp = (x + (z + t_1)) - t_2;
} else {
tmp = t_1 + ((z + y) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = z * math.log(t) tmp = 0 if (x + y) <= -8e-52: tmp = (x + (z + t_1)) - t_2 else: tmp = t_1 + ((z + y) - t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(z * log(t)) tmp = 0.0 if (Float64(x + y) <= -8e-52) tmp = Float64(Float64(x + Float64(z + t_1)) - t_2); else tmp = Float64(t_1 + Float64(Float64(z + y) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); t_2 = z * log(t); tmp = 0.0; if ((x + y) <= -8e-52) tmp = (x + (z + t_1)) - t_2; else tmp = t_1 + ((z + y) - t_2); 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[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -8e-52], N[(N[(x + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], N[(t$95$1 + N[(N[(z + y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := z \cdot \log t\\
\mathbf{if}\;x + y \leq -8 \cdot 10^{-52}:\\
\;\;\;\;\left(x + \left(z + t\_1\right)\right) - t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(z + y\right) - t\_2\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -8.0000000000000001e-52Initial program 99.9%
Taylor expanded in y around 0 66.2%
if -8.0000000000000001e-52 < (+.f64 x y) Initial program 99.2%
Taylor expanded in x around 0 82.7%
Final simplification76.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.9e+101) (not (<= z 2.9e+101))) (+ 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 <= -1.9e+101) || !(z <= 2.9e+101)) {
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 <= (-1.9d+101)) .or. (.not. (z <= 2.9d+101))) 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 <= -1.9e+101) || !(z <= 2.9e+101)) {
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 <= -1.9e+101) or not (z <= 2.9e+101): 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 <= -1.9e+101) || !(z <= 2.9e+101)) 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 <= -1.9e+101) || ~((z <= 2.9e+101))) 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, -1.9e+101], N[Not[LessEqual[z, 2.9e+101]], $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 -1.9 \cdot 10^{+101} \lor \neg \left(z \leq 2.9 \cdot 10^{+101}\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 < -1.8999999999999999e101 or 2.89999999999999987e101 < z Initial program 98.6%
+-commutative98.6%
associate--l+98.6%
associate-+r+98.6%
+-commutative98.6%
*-lft-identity98.6%
metadata-eval98.6%
*-commutative98.6%
distribute-rgt-out--98.7%
metadata-eval98.7%
fma-define98.7%
sub-neg98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in b around 0 82.5%
if -1.8999999999999999e101 < z < 2.89999999999999987e101Initial program 100.0%
Taylor expanded in z around 0 96.7%
Final simplification91.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9e+195) (not (<= z 4.5e+102))) (+ (* z (- 1.0 (log t))) x) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9e+195) || !(z <= 4.5e+102)) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-9d+195)) .or. (.not. (z <= 4.5d+102))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = (x + y) + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9e+195) || !(z <= 4.5e+102)) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9e+195) or not (z <= 4.5e+102): tmp = (z * (1.0 - math.log(t))) + x else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9e+195) || !(z <= 4.5e+102)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -9e+195) || ~((z <= 4.5e+102))) tmp = (z * (1.0 - log(t))) + x; else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9e+195], N[Not[LessEqual[z, 4.5e+102]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+195} \lor \neg \left(z \leq 4.5 \cdot 10^{+102}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -9.00000000000000018e195 or 4.50000000000000021e102 < z Initial program 98.1%
add-cube-cbrt97.3%
pow397.4%
Applied egg-rr97.4%
Taylor expanded in y around 0 77.9%
associate-+r+77.9%
sub-neg77.9%
metadata-eval77.9%
Simplified77.9%
Taylor expanded in b around 0 64.7%
associate--l+64.7%
*-rgt-identity64.7%
unsub-neg64.7%
distribute-rgt-neg-in64.7%
distribute-lft-in64.7%
sub-neg64.7%
Simplified64.7%
if -9.00000000000000018e195 < z < 4.50000000000000021e102Initial program 99.9%
Taylor expanded in z around 0 92.4%
Final simplification85.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.8e+197) (not (<= z 3.1e+188))) (* 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 <= -6.8e+197) || !(z <= 3.1e+188)) {
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 <= (-6.8d+197)) .or. (.not. (z <= 3.1d+188))) 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 <= -6.8e+197) || !(z <= 3.1e+188)) {
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 <= -6.8e+197) or not (z <= 3.1e+188): 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 <= -6.8e+197) || !(z <= 3.1e+188)) 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 <= -6.8e+197) || ~((z <= 3.1e+188))) 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, -6.8e+197], N[Not[LessEqual[z, 3.1e+188]], $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 -6.8 \cdot 10^{+197} \lor \neg \left(z \leq 3.1 \cdot 10^{+188}\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 < -6.80000000000000033e197 or 3.1000000000000002e188 < z Initial program 97.5%
add-cube-cbrt96.7%
pow396.7%
Applied egg-rr96.7%
Taylor expanded in z around inf 66.9%
if -6.80000000000000033e197 < z < 3.1000000000000002e188Initial program 99.9%
Taylor expanded in z around 0 90.1%
Final simplification85.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -6.4e+195) (* z (- 1.0 (log t))) (if (<= z 3.7e+188) (+ (+ 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 <= -6.4e+195) {
tmp = z * (1.0 - log(t));
} else if (z <= 3.7e+188) {
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 <= (-6.4d+195)) then
tmp = z * (1.0d0 - log(t))
else if (z <= 3.7d+188) 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 <= -6.4e+195) {
tmp = z * (1.0 - Math.log(t));
} else if (z <= 3.7e+188) {
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 <= -6.4e+195: tmp = z * (1.0 - math.log(t)) elif z <= 3.7e+188: 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 <= -6.4e+195) tmp = Float64(z * Float64(1.0 - log(t))); elseif (z <= 3.7e+188) 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 <= -6.4e+195) tmp = z * (1.0 - log(t)); elseif (z <= 3.7e+188) 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, -6.4e+195], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+188], 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 -6.4 \cdot 10^{+195}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+188}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z - z \cdot \log t\\
\end{array}
\end{array}
if z < -6.39999999999999965e195Initial program 99.6%
add-cube-cbrt98.7%
pow398.8%
Applied egg-rr98.8%
Taylor expanded in z around inf 78.4%
if -6.39999999999999965e195 < z < 3.7e188Initial program 99.9%
Taylor expanded in z around 0 90.1%
if 3.7e188 < z Initial program 96.2%
add-cube-cbrt95.4%
pow395.4%
Applied egg-rr95.4%
Taylor expanded in y around 0 78.1%
associate-+r+78.1%
sub-neg78.1%
metadata-eval78.1%
Simplified78.1%
Taylor expanded in z around inf 59.7%
Final simplification85.7%
(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.5%
Final simplification99.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (or (<= t_1 -5e+38) (not (<= t_1 8e+123))) (+ x t_1) (+ 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 <= -5e+38) || !(t_1 <= 8e+123)) {
tmp = x + t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-5d+38)) .or. (.not. (t_1 <= 8d+123))) then
tmp = x + t_1
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 t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e+38) || !(t_1 <= 8e+123)) {
tmp = x + t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -5e+38) or not (t_1 <= 8e+123): tmp = x + t_1 else: tmp = 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 <= -5e+38) || !(t_1 <= 8e+123)) tmp = Float64(x + t_1); else tmp = 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 <= -5e+38) || ~((t_1 <= 8e+123))) tmp = x + t_1; else tmp = 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, -5e+38], N[Not[LessEqual[t$95$1, 8e+123]], $MachinePrecision]], N[(x + t$95$1), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+38} \lor \neg \left(t\_1 \leq 8 \cdot 10^{+123}\right):\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.9999999999999997e38 or 7.99999999999999982e123 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.1%
Taylor expanded in z around 0 91.2%
Taylor expanded in y around 0 78.1%
if -4.9999999999999997e38 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 7.99999999999999982e123Initial program 99.8%
Taylor expanded in z around 0 67.4%
Taylor expanded in b around 0 61.5%
+-commutative61.5%
Simplified61.5%
Final simplification69.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.85e+115) (not (<= b 3e+99))) (* 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.85e+115) || !(b <= 3e+99)) {
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.85d+115)) .or. (.not. (b <= 3d+99))) 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.85e+115) || !(b <= 3e+99)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.85e+115) or not (b <= 3e+99): 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.85e+115) || !(b <= 3e+99)) 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.85e+115) || ~((b <= 3e+99))) 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.85e+115], N[Not[LessEqual[b, 3e+99]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.85 \cdot 10^{+115} \lor \neg \left(b \leq 3 \cdot 10^{+99}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -1.85000000000000003e115 or 3.00000000000000014e99 < b Initial program 98.7%
+-commutative98.7%
associate--l+98.7%
associate-+r+98.7%
+-commutative98.7%
*-lft-identity98.7%
metadata-eval98.7%
*-commutative98.7%
distribute-rgt-out--98.7%
metadata-eval98.7%
fma-define98.7%
sub-neg98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in b around inf 73.2%
if -1.85000000000000003e115 < b < 3.00000000000000014e99Initial program 99.8%
Taylor expanded in z around 0 71.2%
Taylor expanded in b around 0 55.9%
+-commutative55.9%
Simplified55.9%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.15e+77) (not (<= a 7.8e+160))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.15e+77) || !(a <= 7.8e+160)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2.15d+77)) .or. (.not. (a <= 7.8d+160))) then
tmp = a * b
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.15e+77) || !(a <= 7.8e+160)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.15e+77) or not (a <= 7.8e+160): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.15e+77) || !(a <= 7.8e+160)) tmp = Float64(a * b); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.15e+77) || ~((a <= 7.8e+160))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.15e+77], N[Not[LessEqual[a, 7.8e+160]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.15 \cdot 10^{+77} \lor \neg \left(a \leq 7.8 \cdot 10^{+160}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -2.14999999999999996e77 or 7.80000000000000014e160 < a Initial program 98.7%
+-commutative98.7%
associate--l+98.7%
associate-+r+98.7%
+-commutative98.7%
*-lft-identity98.7%
metadata-eval98.7%
*-commutative98.7%
distribute-rgt-out--98.7%
metadata-eval98.7%
fma-define98.7%
sub-neg98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in a around inf 56.8%
*-commutative56.8%
Simplified56.8%
if -2.14999999999999996e77 < a < 7.80000000000000014e160Initial program 99.8%
Taylor expanded in z around 0 77.4%
Taylor expanded in b around 0 54.0%
+-commutative54.0%
Simplified54.0%
Final simplification54.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -4.9e+69) x (if (<= x 9.5e-234) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.9e+69) {
tmp = x;
} else if (x <= 9.5e-234) {
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 <= (-4.9d+69)) then
tmp = x
else if (x <= 9.5d-234) 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 <= -4.9e+69) {
tmp = x;
} else if (x <= 9.5e-234) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4.9e+69: tmp = x elif x <= 9.5e-234: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.9e+69) tmp = x; elseif (x <= 9.5e-234) 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 <= -4.9e+69) tmp = x; elseif (x <= 9.5e-234) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.9e+69], x, If[LessEqual[x, 9.5e-234], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{+69}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-234}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -4.9e69Initial 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 x around inf 57.5%
if -4.9e69 < x < 9.4999999999999999e-234Initial 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 a around inf 28.6%
*-commutative28.6%
Simplified28.6%
if 9.4999999999999999e-234 < x Initial program 99.1%
+-commutative99.1%
associate--l+99.1%
associate-+r+99.1%
+-commutative99.1%
*-lft-identity99.1%
metadata-eval99.1%
*-commutative99.1%
distribute-rgt-out--99.1%
metadata-eval99.1%
fma-define99.1%
sub-neg99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in y around inf 27.1%
Final simplification32.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= x -6.4e+35) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (x <= -6.4e+35) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (x <= (-6.4d+35)) then
tmp = x + t_1
else
tmp = y + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (x <= -6.4e+35) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if x <= -6.4e+35: tmp = x + t_1 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (x <= -6.4e+35) tmp = Float64(x + t_1); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (x <= -6.4e+35) tmp = x + t_1; else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.4e+35], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x \leq -6.4 \cdot 10^{+35}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if x < -6.39999999999999965e35Initial program 99.8%
Taylor expanded in z around 0 85.9%
Taylor expanded in y around 0 74.6%
if -6.39999999999999965e35 < x Initial program 99.4%
Taylor expanded in z around 0 77.2%
Taylor expanded in x around 0 64.6%
Final simplification66.5%
(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.5%
Taylor expanded in z around 0 78.9%
Final simplification78.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8.5e+35) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.5e+35) {
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 <= (-8.5d+35)) 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 <= -8.5e+35) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8.5e+35: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.5e+35) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -8.5e+35) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.5e+35], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+35}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -8.4999999999999995e35Initial 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 x around inf 50.7%
if -8.4999999999999995e35 < x Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
associate-+r+99.4%
+-commutative99.4%
*-lft-identity99.4%
metadata-eval99.4%
*-commutative99.4%
distribute-rgt-out--99.4%
metadata-eval99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 28.0%
Final simplification32.2%
(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.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.5%
metadata-eval99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 21.8%
Final simplification21.8%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + y) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}
herbie shell --seed 2024059
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))