
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (+ (* z (- 1.0 (log t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * (1.0 - log(t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * Float64(1.0 - log(t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -4e+144) (not (<= t_1 6e+116)))
(+ x (+ y (* (+ a -0.5) b)))
(+ (* 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 <= -4e+144) || !(t_1 <= 6e+116)) {
tmp = x + (y + ((a + -0.5) * b));
} 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 <= (-4d+144)) .or. (.not. (t_1 <= 6d+116))) then
tmp = x + (y + ((a + (-0.5d0)) * b))
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 <= -4e+144) || !(t_1 <= 6e+116)) {
tmp = x + (y + ((a + -0.5) * b));
} 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 <= -4e+144) or not (t_1 <= 6e+116): tmp = x + (y + ((a + -0.5) * b)) 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 <= -4e+144) || !(t_1 <= 6e+116)) tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); 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 <= -4e+144) || ~((t_1 <= 6e+116))) tmp = x + (y + ((a + -0.5) * b)); 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, -4e+144], N[Not[LessEqual[t$95$1, 6e+116]], $MachinePrecision]], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $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 -4 \cdot 10^{+144} \lor \neg \left(t\_1 \leq 6 \cdot 10^{+116}\right):\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\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) < -4.00000000000000009e144 or 5.9999999999999997e116 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 94.0%
+-commutative94.0%
distribute-rgt-in94.0%
Simplified94.0%
if -4.00000000000000009e144 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.9999999999999997e116Initial 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 b around 0 91.9%
Final simplification92.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (+ a -0.5) b)) (t_2 (* z (log t)))) (if (<= (+ x y) -5e-27) (- (+ (+ z x) 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 = (a + -0.5) * b;
double t_2 = z * log(t);
double tmp;
if ((x + y) <= -5e-27) {
tmp = ((z + x) + 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 = (a + (-0.5d0)) * b
t_2 = z * log(t)
if ((x + y) <= (-5d-27)) then
tmp = ((z + x) + 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 = (a + -0.5) * b;
double t_2 = z * Math.log(t);
double tmp;
if ((x + y) <= -5e-27) {
tmp = ((z + x) + t_1) - t_2;
} else {
tmp = (t_1 + (z + y)) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + -0.5) * b t_2 = z * math.log(t) tmp = 0 if (x + y) <= -5e-27: tmp = ((z + x) + 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(Float64(a + -0.5) * b) t_2 = Float64(z * log(t)) tmp = 0.0 if (Float64(x + y) <= -5e-27) tmp = Float64(Float64(Float64(z + x) + t_1) - t_2); else tmp = Float64(Float64(t_1 + Float64(z + y)) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + -0.5) * b; t_2 = z * log(t); tmp = 0.0; if ((x + y) <= -5e-27) tmp = ((z + x) + 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[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -5e-27], N[(N[(N[(z + x), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(t$95$1 + N[(z + y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
t_2 := z \cdot \log t\\
\mathbf{if}\;x + y \leq -5 \cdot 10^{-27}:\\
\;\;\;\;\left(\left(z + x\right) + t\_1\right) - t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \left(z + y\right)\right) - t\_2\\
\end{array}
\end{array}
if (+.f64 x y) < -5.0000000000000002e-27Initial program 99.9%
Taylor expanded in y around 0 68.8%
associate-+r+68.8%
+-commutative68.8%
sub-neg68.8%
metadata-eval68.8%
+-commutative68.8%
Simplified68.8%
if -5.0000000000000002e-27 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 87.7%
associate-+r+87.7%
+-commutative87.7%
sub-neg87.7%
metadata-eval87.7%
+-commutative87.7%
Simplified87.7%
Final simplification80.7%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 5e+102) (- (+ (+ z x) (* (+ a -0.5) b)) (* z (log t))) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5e+102) {
tmp = ((z + x) + ((a + -0.5) * b)) - (z * log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (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 ((x + y) <= 5d+102) then
tmp = ((z + x) + ((a + (-0.5d0)) * b)) - (z * log(t))
else
tmp = x + (y + (((-0.5d0) * b) + (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 ((x + y) <= 5e+102) {
tmp = ((z + x) + ((a + -0.5) * b)) - (z * Math.log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 5e+102: tmp = ((z + x) + ((a + -0.5) * b)) - (z * math.log(t)) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 5e+102) tmp = Float64(Float64(Float64(z + x) + Float64(Float64(a + -0.5) * b)) - Float64(z * log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= 5e+102) tmp = ((z + x) + ((a + -0.5) * b)) - (z * log(t)); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 5e+102], N[(N[(N[(z + x), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 5 \cdot 10^{+102}:\\
\;\;\;\;\left(\left(z + x\right) + \left(a + -0.5\right) \cdot b\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < 5e102Initial program 99.8%
Taylor expanded in y around 0 80.5%
associate-+r+80.5%
+-commutative80.5%
sub-neg80.5%
metadata-eval80.5%
+-commutative80.5%
Simplified80.5%
if 5e102 < (+.f64 x y) Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 89.8%
Final simplification83.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.1e+225) (not (<= z 6e+166))) (+ (* z (- 1.0 (log t))) (* a b)) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.1e+225) || !(z <= 6e+166)) {
tmp = (z * (1.0 - log(t))) + (a * b);
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.1d+225)) .or. (.not. (z <= 6d+166))) then
tmp = (z * (1.0d0 - log(t))) + (a * b)
else
tmp = x + (y + ((a + (-0.5d0)) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.1e+225) || !(z <= 6e+166)) {
tmp = (z * (1.0 - Math.log(t))) + (a * b);
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.1e+225) or not (z <= 6e+166): tmp = (z * (1.0 - math.log(t))) + (a * b) else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.1e+225) || !(z <= 6e+166)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(a * b)); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.1e+225) || ~((z <= 6e+166))) tmp = (z * (1.0 - log(t))) + (a * b); else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.1e+225], N[Not[LessEqual[z, 6e+166]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+225} \lor \neg \left(z \leq 6 \cdot 10^{+166}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -2.1e225 or 5.99999999999999997e166 < z 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.7%
metadata-eval99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in a around inf 86.8%
*-commutative86.8%
Simplified86.8%
if -2.1e225 < z < 5.99999999999999997e166Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.0%
+-commutative90.0%
distribute-rgt-in90.0%
Simplified90.0%
Final simplification89.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.35e+241) (not (<= z 3.7e+209))) (+ (* z (- 1.0 (log t))) x) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.35e+241) || !(z <= 3.7e+209)) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.35d+241)) .or. (.not. (z <= 3.7d+209))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = x + (y + ((a + (-0.5d0)) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.35e+241) || !(z <= 3.7e+209)) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.35e+241) or not (z <= 3.7e+209): tmp = (z * (1.0 - math.log(t))) + x else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.35e+241) || !(z <= 3.7e+209)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.35e+241) || ~((z <= 3.7e+209))) tmp = (z * (1.0 - log(t))) + x; else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.35e+241], N[Not[LessEqual[z, 3.7e+209]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+241} \lor \neg \left(z \leq 3.7 \cdot 10^{+209}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -1.34999999999999986e241 or 3.7e209 < z 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.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 76.1%
if -1.34999999999999986e241 < z < 3.7e209Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 88.4%
+-commutative88.4%
distribute-rgt-in88.4%
Simplified88.4%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -6.8e+240)
(+ t_1 y)
(if (<= z 3.6e+207) (+ x (+ y (* (+ a -0.5) b))) (+ t_1 x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - log(t));
double tmp;
if (z <= -6.8e+240) {
tmp = t_1 + y;
} else if (z <= 3.6e+207) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = t_1 + 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 = z * (1.0d0 - log(t))
if (z <= (-6.8d+240)) then
tmp = t_1 + y
else if (z <= 3.6d+207) then
tmp = x + (y + ((a + (-0.5d0)) * b))
else
tmp = t_1 + 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 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -6.8e+240) {
tmp = t_1 + y;
} else if (z <= 3.6e+207) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -6.8e+240: tmp = t_1 + y elif z <= 3.6e+207: tmp = x + (y + ((a + -0.5) * b)) else: tmp = t_1 + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -6.8e+240) tmp = Float64(t_1 + y); elseif (z <= 3.6e+207) tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); else tmp = Float64(t_1 + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (1.0 - log(t)); tmp = 0.0; if (z <= -6.8e+240) tmp = t_1 + y; elseif (z <= 3.6e+207) tmp = x + (y + ((a + -0.5) * b)); else tmp = t_1 + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e+240], N[(t$95$1 + y), $MachinePrecision], If[LessEqual[z, 3.6e+207], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+240}:\\
\;\;\;\;t\_1 + y\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+207}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if z < -6.80000000000000017e240Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
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 92.1%
if -6.80000000000000017e240 < z < 3.60000000000000014e207Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 88.4%
+-commutative88.4%
distribute-rgt-in88.4%
Simplified88.4%
if 3.60000000000000014e207 < z Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
associate-+r+99.3%
+-commutative99.3%
*-lft-identity99.3%
metadata-eval99.3%
*-commutative99.3%
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 70.3%
Final simplification87.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.8e+240) (not (<= z 3.3e+219))) (* z (- 1.0 (log t))) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.8e+240) || !(z <= 3.3e+219)) {
tmp = z * (1.0 - log(t));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-6.8d+240)) .or. (.not. (z <= 3.3d+219))) then
tmp = z * (1.0d0 - log(t))
else
tmp = x + (y + ((a + (-0.5d0)) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.8e+240) || !(z <= 3.3e+219)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.8e+240) or not (z <= 3.3e+219): tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.8e+240) || !(z <= 3.3e+219)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6.8e+240) || ~((z <= 3.3e+219))) tmp = z * (1.0 - log(t)); else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.8e+240], N[Not[LessEqual[z, 3.3e+219]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+240} \lor \neg \left(z \leq 3.3 \cdot 10^{+219}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -6.80000000000000017e240 or 3.3000000000000002e219 < z 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.5%
metadata-eval99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 78.5%
Taylor expanded in z around inf 78.3%
if -6.80000000000000017e240 < z < 3.3000000000000002e219Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 87.8%
+-commutative87.8%
distribute-rgt-in87.8%
Simplified87.8%
Final simplification86.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.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -5e+29) (+ x (* a b)) (if (<= (+ x y) 2e+165) (* b (- a 0.5)) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -5e+29) {
tmp = x + (a * b);
} else if ((x + y) <= 2e+165) {
tmp = b * (a - 0.5);
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= (-5d+29)) then
tmp = x + (a * b)
else if ((x + y) <= 2d+165) then
tmp = b * (a - 0.5d0)
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -5e+29) {
tmp = x + (a * b);
} else if ((x + y) <= 2e+165) {
tmp = b * (a - 0.5);
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -5e+29: tmp = x + (a * b) elif (x + y) <= 2e+165: tmp = b * (a - 0.5) else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -5e+29) tmp = Float64(x + Float64(a * b)); elseif (Float64(x + y) <= 2e+165) tmp = Float64(b * Float64(a - 0.5)); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -5e+29) tmp = x + (a * b); elseif ((x + y) <= 2e+165) tmp = b * (a - 0.5); else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -5e+29], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 2e+165], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -5 \cdot 10^{+29}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;x + y \leq 2 \cdot 10^{+165}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if (+.f64 x y) < -5.0000000000000001e29Initial program 99.9%
Taylor expanded in y around 0 63.1%
associate-+r+63.1%
+-commutative63.1%
sub-neg63.1%
metadata-eval63.1%
+-commutative63.1%
Simplified63.1%
Taylor expanded in z around 0 55.8%
Taylor expanded in a around inf 52.1%
*-commutative52.1%
Simplified52.1%
if -5.0000000000000001e29 < (+.f64 x y) < 1.9999999999999998e165Initial 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 68.6%
associate-+r+68.6%
sub-neg68.6%
metadata-eval68.6%
associate-/l*67.7%
+-commutative67.7%
associate-/l*67.6%
Simplified67.6%
Taylor expanded in b around inf 47.9%
associate-*r/47.9%
metadata-eval47.9%
div-sub47.9%
sub-neg47.9%
metadata-eval47.9%
Simplified47.9%
Taylor expanded in y around 0 52.4%
if 1.9999999999999998e165 < (+.f64 x y) Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in y around inf 40.4%
Final simplification49.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.1e-99) (not (<= b 5.5e-56))) (+ x (* 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.1e-99) || !(b <= 5.5e-56)) {
tmp = x + (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.1d-99)) .or. (.not. (b <= 5.5d-56))) then
tmp = x + (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.1e-99) || !(b <= 5.5e-56)) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.1e-99) or not (b <= 5.5e-56): tmp = x + (b * (a - 0.5)) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.1e-99) || !(b <= 5.5e-56)) tmp = Float64(x + 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.1e-99) || ~((b <= 5.5e-56))) tmp = x + (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.1e-99], N[Not[LessEqual[b, 5.5e-56]], $MachinePrecision]], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{-99} \lor \neg \left(b \leq 5.5 \cdot 10^{-56}\right):\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -1.10000000000000002e-99 or 5.4999999999999999e-56 < b Initial program 99.9%
Taylor expanded in y around 0 83.5%
associate-+r+83.5%
+-commutative83.5%
sub-neg83.5%
metadata-eval83.5%
+-commutative83.5%
Simplified83.5%
Taylor expanded in z around 0 69.9%
if -1.10000000000000002e-99 < b < 5.4999999999999999e-56Initial 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 b around 0 93.8%
Taylor expanded in z around 0 63.3%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.36e+92) (not (<= b 1.1e-15))) (* 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.36e+92) || !(b <= 1.1e-15)) {
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.36d+92)) .or. (.not. (b <= 1.1d-15))) 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.36e+92) || !(b <= 1.1e-15)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.36e+92) or not (b <= 1.1e-15): 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.36e+92) || !(b <= 1.1e-15)) 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.36e+92) || ~((b <= 1.1e-15))) 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.36e+92], N[Not[LessEqual[b, 1.1e-15]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.36 \cdot 10^{+92} \lor \neg \left(b \leq 1.1 \cdot 10^{-15}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -1.36e92 or 1.09999999999999993e-15 < 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--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 73.0%
associate-+r+73.0%
sub-neg73.0%
metadata-eval73.0%
associate-/l*72.9%
+-commutative72.9%
associate-/l*72.9%
Simplified72.9%
Taylor expanded in b around inf 65.7%
associate-*r/65.7%
metadata-eval65.7%
div-sub65.7%
sub-neg65.7%
metadata-eval65.7%
Simplified65.7%
Taylor expanded in y around 0 68.0%
if -1.36e92 < b < 1.09999999999999993e-15Initial 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 b around 0 85.8%
Taylor expanded in z around 0 59.9%
Final simplification63.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -1e-93) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -1e-93) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= (-1d-93)) then
tmp = x + t_1
else
tmp = y + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -1e-93) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= -1e-93: tmp = x + t_1 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -1e-93) tmp = Float64(x + t_1); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -1e-93) tmp = x + t_1; else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -1e-93], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -1 \cdot 10^{-93}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -9.999999999999999e-94Initial program 99.9%
Taylor expanded in y around 0 70.7%
associate-+r+70.7%
+-commutative70.7%
sub-neg70.7%
metadata-eval70.7%
+-commutative70.7%
Simplified70.7%
Taylor expanded in z around 0 53.6%
if -9.999999999999999e-94 < (+.f64 x y) Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 78.7%
+-commutative78.7%
distribute-rgt-in78.7%
Simplified78.7%
Taylor expanded in x around 0 66.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.7e+94) (not (<= a 3.6e+93))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.7e+94) || !(a <= 3.6e+93)) {
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.7d+94)) .or. (.not. (a <= 3.6d+93))) 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.7e+94) || !(a <= 3.6e+93)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.7e+94) or not (a <= 3.6e+93): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.7e+94) || !(a <= 3.6e+93)) 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.7e+94) || ~((a <= 3.6e+93))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.7e+94], N[Not[LessEqual[a, 3.6e+93]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+94} \lor \neg \left(a \leq 3.6 \cdot 10^{+93}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -2.7000000000000001e94 or 3.5999999999999999e93 < a Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 75.2%
associate-+r+75.2%
sub-neg75.2%
metadata-eval75.2%
associate-/l*74.0%
+-commutative74.0%
associate-/l*74.0%
Simplified74.0%
Taylor expanded in b around inf 56.6%
associate-*r/56.6%
metadata-eval56.6%
div-sub56.6%
sub-neg56.6%
metadata-eval56.6%
Simplified56.6%
Taylor expanded in a around inf 63.6%
if -2.7000000000000001e94 < a < 3.5999999999999999e93Initial 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 b around 0 78.1%
Taylor expanded in z around 0 51.9%
Final simplification56.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8e+181) x (if (<= x 4e-295) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8e+181) {
tmp = x;
} else if (x <= 4e-295) {
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 <= (-8d+181)) then
tmp = x
else if (x <= 4d-295) 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 <= -8e+181) {
tmp = x;
} else if (x <= 4e-295) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8e+181: tmp = x elif x <= 4e-295: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8e+181) tmp = x; elseif (x <= 4e-295) 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 <= -8e+181) tmp = x; elseif (x <= 4e-295) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8e+181], x, If[LessEqual[x, 4e-295], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+181}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-295}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -7.9999999999999993e181Initial 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 x around inf 78.9%
Taylor expanded in z around 0 79.2%
if -7.9999999999999993e181 < x < 4.00000000000000024e-295Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 80.8%
associate-+r+80.8%
sub-neg80.8%
metadata-eval80.8%
associate-/l*80.7%
+-commutative80.7%
associate-/l*80.7%
Simplified80.7%
Taylor expanded in b around inf 43.6%
associate-*r/43.6%
metadata-eval43.6%
div-sub43.5%
sub-neg43.5%
metadata-eval43.5%
Simplified43.5%
Taylor expanded in a around inf 34.6%
if 4.00000000000000024e-295 < x Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in y around inf 27.1%
Final simplification35.0%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (* (+ a -0.5) b))))
double code(double x, double y, double z, double t, double a, double b) {
return 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 = 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 x + (y + ((a + -0.5) * b));
}
def code(x, y, z, t, a, b): return x + (y + ((a + -0.5) * b))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + ((a + -0.5) * b)); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \left(a + -0.5\right) \cdot b\right)
\end{array}
Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 79.7%
+-commutative79.7%
distribute-rgt-in79.7%
Simplified79.7%
Final simplification79.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.75e+54) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.75e+54) {
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.75d+54)) 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.75e+54) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.75e+54: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.75e+54) 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.75e+54) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.75e+54], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+54}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.7500000000000001e54Initial 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 x around inf 56.1%
Taylor expanded in z around 0 48.8%
if -1.7500000000000001e54 < x Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in y around inf 26.6%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 38.6%
Taylor expanded in z around 0 19.4%
(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 2024157
(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)))