
(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 14 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%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))) (t_2 (* b (- a 0.5))))
(if (<= (+ x y) 2e+26)
(+ t_2 (- (+ z x) t_1))
(if (or (<= (+ x y) 5e+191) (not (<= (+ x y) 1.5e+277)))
(+ (+ x y) t_2)
(+ (- (+ z (+ x y)) t_1) (* -0.5 b))))))
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) <= 2e+26) {
tmp = t_2 + ((z + x) - t_1);
} else if (((x + y) <= 5e+191) || !((x + y) <= 1.5e+277)) {
tmp = (x + y) + t_2;
} else {
tmp = ((z + (x + y)) - t_1) + (-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) :: t_2
real(8) :: tmp
t_1 = z * log(t)
t_2 = b * (a - 0.5d0)
if ((x + y) <= 2d+26) then
tmp = t_2 + ((z + x) - t_1)
else if (((x + y) <= 5d+191) .or. (.not. ((x + y) <= 1.5d+277))) then
tmp = (x + y) + t_2
else
tmp = ((z + (x + y)) - t_1) + ((-0.5d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * Math.log(t);
double t_2 = b * (a - 0.5);
double tmp;
if ((x + y) <= 2e+26) {
tmp = t_2 + ((z + x) - t_1);
} else if (((x + y) <= 5e+191) || !((x + y) <= 1.5e+277)) {
tmp = (x + y) + t_2;
} else {
tmp = ((z + (x + y)) - t_1) + (-0.5 * b);
}
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) <= 2e+26: tmp = t_2 + ((z + x) - t_1) elif ((x + y) <= 5e+191) or not ((x + y) <= 1.5e+277): tmp = (x + y) + t_2 else: tmp = ((z + (x + y)) - t_1) + (-0.5 * b) 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) <= 2e+26) tmp = Float64(t_2 + Float64(Float64(z + x) - t_1)); elseif ((Float64(x + y) <= 5e+191) || !(Float64(x + y) <= 1.5e+277)) tmp = Float64(Float64(x + y) + t_2); else tmp = Float64(Float64(Float64(z + Float64(x + y)) - t_1) + Float64(-0.5 * b)); 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) <= 2e+26) tmp = t_2 + ((z + x) - t_1); elseif (((x + y) <= 5e+191) || ~(((x + y) <= 1.5e+277))) tmp = (x + y) + t_2; else tmp = ((z + (x + y)) - t_1) + (-0.5 * b); 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], 2e+26], N[(t$95$2 + N[(N[(z + x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(x + y), $MachinePrecision], 5e+191], N[Not[LessEqual[N[(x + y), $MachinePrecision], 1.5e+277]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + t$95$2), $MachinePrecision], N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(-0.5 * b), $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 2 \cdot 10^{+26}:\\
\;\;\;\;t\_2 + \left(\left(z + x\right) - t\_1\right)\\
\mathbf{elif}\;x + y \leq 5 \cdot 10^{+191} \lor \neg \left(x + y \leq 1.5 \cdot 10^{+277}\right):\\
\;\;\;\;\left(x + y\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(z + \left(x + y\right)\right) - t\_1\right) + -0.5 \cdot b\\
\end{array}
\end{array}
if (+.f64 x y) < 2.0000000000000001e26Initial program 99.9%
Taylor expanded in y around 0 74.5%
+-commutative74.5%
Simplified74.5%
if 2.0000000000000001e26 < (+.f64 x y) < 5.0000000000000002e191 or 1.49999999999999991e277 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around 0 93.8%
if 5.0000000000000002e191 < (+.f64 x y) < 1.49999999999999991e277Initial program 99.9%
Taylor expanded in a around 0 96.6%
*-commutative58.3%
Simplified96.6%
Final simplification81.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -5e-21) (not (<= t_1 2e+117)))
(+ (+ x y) t_1)
(+ x (+ (* z (- 1.0 (log t))) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e-21) || !(t_1 <= 2e+117)) {
tmp = (x + y) + t_1;
} else {
tmp = x + ((z * (1.0 - log(t))) + y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-5d-21)) .or. (.not. (t_1 <= 2d+117))) then
tmp = (x + y) + t_1
else
tmp = x + ((z * (1.0d0 - log(t))) + y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e-21) || !(t_1 <= 2e+117)) {
tmp = (x + y) + t_1;
} else {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -5e-21) or not (t_1 <= 2e+117): tmp = (x + y) + t_1 else: tmp = x + ((z * (1.0 - math.log(t))) + y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -5e-21) || !(t_1 <= 2e+117)) tmp = Float64(Float64(x + y) + t_1); else tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -5e-21) || ~((t_1 <= 2e+117))) tmp = (x + y) + t_1; else tmp = x + ((z * (1.0 - log(t))) + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e-21], N[Not[LessEqual[t$95$1, 2e+117]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-21} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+117}\right):\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.99999999999999973e-21 or 2.0000000000000001e117 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in z around 0 91.4%
if -4.99999999999999973e-21 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.0000000000000001e117Initial 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--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 99.1%
Final simplification95.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 2e+26) (+ t_1 (- (+ z x) (* z (log t)))) (+ (+ x y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 2e+26) {
tmp = t_1 + ((z + x) - (z * log(t)));
} else {
tmp = (x + 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) <= 2d+26) then
tmp = t_1 + ((z + x) - (z * log(t)))
else
tmp = (x + 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) <= 2e+26) {
tmp = t_1 + ((z + x) - (z * Math.log(t)));
} else {
tmp = (x + y) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= 2e+26: tmp = t_1 + ((z + x) - (z * math.log(t))) else: tmp = (x + 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) <= 2e+26) tmp = Float64(t_1 + Float64(Float64(z + x) - Float64(z * log(t)))); else tmp = Float64(Float64(x + 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) <= 2e+26) tmp = t_1 + ((z + x) - (z * log(t))); else tmp = (x + 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], 2e+26], N[(t$95$1 + N[(N[(z + x), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq 2 \cdot 10^{+26}:\\
\;\;\;\;t\_1 + \left(\left(z + x\right) - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < 2.0000000000000001e26Initial program 99.9%
Taylor expanded in y around 0 74.5%
+-commutative74.5%
Simplified74.5%
if 2.0000000000000001e26 < (+.f64 x y) Initial program 99.9%
Taylor expanded in z around 0 89.7%
Final simplification79.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.8e+222) (not (<= z 7.6e+235))) (- z (* z (log t))) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.8e+222) || !(z <= 7.6e+235)) {
tmp = z - (z * log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-8.8d+222)) .or. (.not. (z <= 7.6d+235))) then
tmp = z - (z * log(t))
else
tmp = (x + y) + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.8e+222) || !(z <= 7.6e+235)) {
tmp = z - (z * Math.log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.8e+222) or not (z <= 7.6e+235): tmp = z - (z * math.log(t)) else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.8e+222) || !(z <= 7.6e+235)) tmp = Float64(z - Float64(z * log(t))); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.8e+222) || ~((z <= 7.6e+235))) tmp = z - (z * log(t)); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.8e+222], N[Not[LessEqual[z, 7.6e+235]], $MachinePrecision]], N[(z - N[(z * 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 -8.8 \cdot 10^{+222} \lor \neg \left(z \leq 7.6 \cdot 10^{+235}\right):\\
\;\;\;\;z - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -8.8000000000000004e222 or 7.5999999999999995e235 < z Initial program 99.6%
Taylor expanded in y around 0 83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in a around 0 75.3%
*-commutative48.6%
Simplified75.3%
Taylor expanded in x around 0 68.2%
Taylor expanded in b around 0 65.0%
if -8.8000000000000004e222 < z < 7.5999999999999995e235Initial program 99.9%
Taylor expanded in z around 0 89.8%
Final simplification87.4%
(FPCore (x y z t a b) :precision binary64 (+ (- (+ z (+ x y)) (* z (log t))) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * Math.log(t))) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return ((z + (x + y)) - (z * math.log(t))) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z + Float64(x + y)) - Float64(z * log(t))) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -3.6e+112)
x
(if (or (<= x 6.2e-197) (and (not (<= x 7.8e-166)) (<= x 7.5e-51)))
(* b (- a 0.5))
y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.6e+112) {
tmp = x;
} else if ((x <= 6.2e-197) || (!(x <= 7.8e-166) && (x <= 7.5e-51))) {
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 <= (-3.6d+112)) then
tmp = x
else if ((x <= 6.2d-197) .or. (.not. (x <= 7.8d-166)) .and. (x <= 7.5d-51)) 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 <= -3.6e+112) {
tmp = x;
} else if ((x <= 6.2e-197) || (!(x <= 7.8e-166) && (x <= 7.5e-51))) {
tmp = b * (a - 0.5);
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.6e+112: tmp = x elif (x <= 6.2e-197) or (not (x <= 7.8e-166) and (x <= 7.5e-51)): tmp = b * (a - 0.5) else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.6e+112) tmp = x; elseif ((x <= 6.2e-197) || (!(x <= 7.8e-166) && (x <= 7.5e-51))) 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 <= -3.6e+112) tmp = x; elseif ((x <= 6.2e-197) || (~((x <= 7.8e-166)) && (x <= 7.5e-51))) tmp = b * (a - 0.5); else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.6e+112], x, If[Or[LessEqual[x, 6.2e-197], And[N[Not[LessEqual[x, 7.8e-166]], $MachinePrecision], LessEqual[x, 7.5e-51]]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+112}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-197} \lor \neg \left(x \leq 7.8 \cdot 10^{-166}\right) \land x \leq 7.5 \cdot 10^{-51}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -3.6e112Initial 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 50.9%
if -3.6e112 < x < 6.20000000000000057e-197 or 7.79999999999999998e-166 < x < 7.49999999999999976e-51Initial 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 inf 46.4%
if 6.20000000000000057e-197 < x < 7.79999999999999998e-166 or 7.49999999999999976e-51 < x Initial program 99.9%
+-commutative99.9%
associate--l+100.0%
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 23.5%
Final simplification40.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (+ x (* -0.5 b))))
(if (<= x -4.9e+101)
t_2
(if (<= x -1.05e-9)
t_1
(if (<= x -6.3e-43) t_2 (if (<= x 1.05e-46) t_1 y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = x + (-0.5 * b);
double tmp;
if (x <= -4.9e+101) {
tmp = t_2;
} else if (x <= -1.05e-9) {
tmp = t_1;
} else if (x <= -6.3e-43) {
tmp = t_2;
} else if (x <= 1.05e-46) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = b * (a - 0.5d0)
t_2 = x + ((-0.5d0) * b)
if (x <= (-4.9d+101)) then
tmp = t_2
else if (x <= (-1.05d-9)) then
tmp = t_1
else if (x <= (-6.3d-43)) then
tmp = t_2
else if (x <= 1.05d-46) then
tmp = t_1
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 t_1 = b * (a - 0.5);
double t_2 = x + (-0.5 * b);
double tmp;
if (x <= -4.9e+101) {
tmp = t_2;
} else if (x <= -1.05e-9) {
tmp = t_1;
} else if (x <= -6.3e-43) {
tmp = t_2;
} else if (x <= 1.05e-46) {
tmp = t_1;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = x + (-0.5 * b) tmp = 0 if x <= -4.9e+101: tmp = t_2 elif x <= -1.05e-9: tmp = t_1 elif x <= -6.3e-43: tmp = t_2 elif x <= 1.05e-46: tmp = t_1 else: tmp = y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(x + Float64(-0.5 * b)) tmp = 0.0 if (x <= -4.9e+101) tmp = t_2; elseif (x <= -1.05e-9) tmp = t_1; elseif (x <= -6.3e-43) tmp = t_2; elseif (x <= 1.05e-46) tmp = t_1; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); t_2 = x + (-0.5 * b); tmp = 0.0; if (x <= -4.9e+101) tmp = t_2; elseif (x <= -1.05e-9) tmp = t_1; elseif (x <= -6.3e-43) tmp = t_2; elseif (x <= 1.05e-46) tmp = t_1; else tmp = 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]}, Block[{t$95$2 = N[(x + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e+101], t$95$2, If[LessEqual[x, -1.05e-9], t$95$1, If[LessEqual[x, -6.3e-43], t$95$2, If[LessEqual[x, 1.05e-46], t$95$1, y]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := x + -0.5 \cdot b\\
\mathbf{if}\;x \leq -4.9 \cdot 10^{+101}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.3 \cdot 10^{-43}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -4.89999999999999983e101 or -1.0500000000000001e-9 < x < -6.3000000000000002e-43Initial program 100.0%
Taylor expanded in y around 0 80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in x around inf 80.8%
Taylor expanded in a around 0 61.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in x around inf 52.0%
if -4.89999999999999983e101 < x < -1.0500000000000001e-9 or -6.3000000000000002e-43 < x < 1.04999999999999994e-46Initial 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 inf 47.1%
if 1.04999999999999994e-46 < x Initial program 99.9%
+-commutative99.9%
associate--l+100.0%
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 22.6%
Final simplification41.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.9e+65)
x
(if (<= x -1.8e-14)
y
(if (<= x -6.3e-43) x (if (<= x 1.2e-59) (* a b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.9e+65) {
tmp = x;
} else if (x <= -1.8e-14) {
tmp = y;
} else if (x <= -6.3e-43) {
tmp = x;
} else if (x <= 1.2e-59) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.9d+65)) then
tmp = x
else if (x <= (-1.8d-14)) then
tmp = y
else if (x <= (-6.3d-43)) then
tmp = x
else if (x <= 1.2d-59) then
tmp = a * b
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.9e+65) {
tmp = x;
} else if (x <= -1.8e-14) {
tmp = y;
} else if (x <= -6.3e-43) {
tmp = x;
} else if (x <= 1.2e-59) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.9e+65: tmp = x elif x <= -1.8e-14: tmp = y elif x <= -6.3e-43: tmp = x elif x <= 1.2e-59: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.9e+65) tmp = x; elseif (x <= -1.8e-14) tmp = y; elseif (x <= -6.3e-43) tmp = x; elseif (x <= 1.2e-59) tmp = Float64(a * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.9e+65) tmp = x; elseif (x <= -1.8e-14) tmp = y; elseif (x <= -6.3e-43) tmp = x; elseif (x <= 1.2e-59) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.9e+65], x, If[LessEqual[x, -1.8e-14], y, If[LessEqual[x, -6.3e-43], x, If[LessEqual[x, 1.2e-59], N[(a * b), $MachinePrecision], y]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+65}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-14}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq -6.3 \cdot 10^{-43}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-59}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.90000000000000006e65 or -1.7999999999999999e-14 < x < -6.3000000000000002e-43Initial 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 44.7%
if -1.90000000000000006e65 < x < -1.7999999999999999e-14 or 1.20000000000000008e-59 < x Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 25.8%
if -6.3000000000000002e-43 < x < 1.20000000000000008e-59Initial 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 34.9%
*-commutative34.9%
Simplified34.9%
Final simplification33.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y 1e+52) (and (not (<= y 9.5e+84)) (<= y 3.4e+143))) (+ x (* b (- a 0.5))) y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= 1e+52) || (!(y <= 9.5e+84) && (y <= 3.4e+143))) {
tmp = x + (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 <= 1d+52) .or. (.not. (y <= 9.5d+84)) .and. (y <= 3.4d+143)) then
tmp = x + (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 <= 1e+52) || (!(y <= 9.5e+84) && (y <= 3.4e+143))) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= 1e+52) or (not (y <= 9.5e+84) and (y <= 3.4e+143)): tmp = x + (b * (a - 0.5)) else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= 1e+52) || (!(y <= 9.5e+84) && (y <= 3.4e+143))) tmp = Float64(x + 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 <= 1e+52) || (~((y <= 9.5e+84)) && (y <= 3.4e+143))) tmp = x + (b * (a - 0.5)); else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, 1e+52], And[N[Not[LessEqual[y, 9.5e+84]], $MachinePrecision], LessEqual[y, 3.4e+143]]], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+52} \lor \neg \left(y \leq 9.5 \cdot 10^{+84}\right) \land y \leq 3.4 \cdot 10^{+143}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 9.9999999999999999e51 or 9.49999999999999979e84 < y < 3.39999999999999982e143Initial program 99.9%
Taylor expanded in y around 0 78.6%
+-commutative78.6%
Simplified78.6%
Taylor expanded in x around inf 71.8%
Taylor expanded in x around inf 61.5%
if 9.9999999999999999e51 < y < 9.49999999999999979e84 or 3.39999999999999982e143 < 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-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 59.7%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 2e-192) (+ 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) <= 2e-192) {
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) <= 2d-192) 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) <= 2e-192) {
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) <= 2e-192: 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) <= 2e-192) 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) <= 2e-192) 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], 2e-192], 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 2 \cdot 10^{-192}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < 2.0000000000000002e-192Initial program 99.9%
Taylor expanded in y around 0 68.0%
+-commutative68.0%
Simplified68.0%
Taylor expanded in x around inf 60.9%
Taylor expanded in x around inf 53.4%
if 2.0000000000000002e-192 < (+.f64 x y) Initial program 99.9%
Taylor expanded in y around inf 73.3%
associate-+r+73.3%
associate--l+73.3%
div-sub74.4%
*-commutative74.4%
cancel-sign-sub-inv74.4%
*-lft-identity74.4%
distribute-rgt-in74.5%
sub-neg74.5%
associate-/l*74.4%
Simplified74.4%
Taylor expanded in y around inf 58.5%
Final simplification55.8%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (a - 0.5));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + y) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return (x + y) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Taylor expanded in z around 0 83.3%
Final simplification83.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y 9.5e+25) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 9.5e+25) {
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 (y <= 9.5d+25) 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 (y <= 9.5e+25) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 9.5e+25: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 9.5e+25) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 9.5e+25) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 9.5e+25], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 9.5000000000000005e25Initial 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 23.8%
if 9.5000000000000005e25 < y Initial program 99.9%
+-commutative99.9%
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 y around inf 46.8%
Final simplification27.8%
(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 23.0%
Final simplification23.0%
(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 2024071
(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)))