
(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 21 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 (- (+ x (+ y (+ z (+ (* -0.5 b) (* b a))))) (* z (log t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * log(t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + (y + (z + (((-0.5d0) * b) + (b * a))))) - (z * log(t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * Math.log(t));
}
def code(x, y, z, t, a, b): return (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * math.log(t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(y + Float64(z + Float64(Float64(-0.5 * b) + Float64(b * a))))) - Float64(z * log(t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * log(t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(y + N[(z + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \left(y + \left(z + \left(-0.5 \cdot b + b \cdot a\right)\right)\right)\right) - z \cdot \log t
\end{array}
Initial program 99.9%
Taylor expanded in a around 0 99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= (+ x y) -500000.0)
(+ x (+ y t_1))
(- (+ y (+ z t_1)) (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -500000.0) {
tmp = x + (y + t_1);
} else {
tmp = (y + (z + t_1)) - (z * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= (-500000.0d0)) then
tmp = x + (y + t_1)
else
tmp = (y + (z + t_1)) - (z * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -500000.0) {
tmp = x + (y + t_1);
} else {
tmp = (y + (z + t_1)) - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= -500000.0: tmp = x + (y + t_1) else: tmp = (y + (z + t_1)) - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -500000.0) tmp = Float64(x + Float64(y + t_1)); else tmp = Float64(Float64(y + Float64(z + t_1)) - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -500000.0) tmp = x + (y + t_1); else tmp = (y + (z + t_1)) - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -500000.0], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -500000:\\
\;\;\;\;x + \left(y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + t_1\right)\right) - z \cdot \log t\\
\end{array}
\end{array}
if (+.f64 x y) < -5e5Initial 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--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 87.3%
if -5e5 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 81.8%
Final simplification83.8%
(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 (or (<= b -8.6e-30) (not (<= b 2.2e-50))) (+ x (+ y (* b (- a 0.5)))) (+ (+ x y) (* z (- 1.0 (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -8.6e-30) || !(b <= 2.2e-50)) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = (x + y) + (z * (1.0 - 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 ((b <= (-8.6d-30)) .or. (.not. (b <= 2.2d-50))) then
tmp = x + (y + (b * (a - 0.5d0)))
else
tmp = (x + y) + (z * (1.0d0 - 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 ((b <= -8.6e-30) || !(b <= 2.2e-50)) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = (x + y) + (z * (1.0 - Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -8.6e-30) or not (b <= 2.2e-50): tmp = x + (y + (b * (a - 0.5))) else: tmp = (x + y) + (z * (1.0 - math.log(t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -8.6e-30) || !(b <= 2.2e-50)) tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); else tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -8.6e-30) || ~((b <= 2.2e-50))) tmp = x + (y + (b * (a - 0.5))); else tmp = (x + y) + (z * (1.0 - log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -8.6e-30], N[Not[LessEqual[b, 2.2e-50]], $MachinePrecision]], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.6 \cdot 10^{-30} \lor \neg \left(b \leq 2.2 \cdot 10^{-50}\right):\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if b < -8.59999999999999932e-30 or 2.1999999999999999e-50 < b Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 90.3%
if -8.59999999999999932e-30 < b < 2.1999999999999999e-50Initial 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.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 95.5%
Final simplification92.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.2e-41) (not (<= b 3.7e-50))) (+ x (+ y (* b (- a 0.5)))) (- (+ x (+ y z)) (* z (log t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.2e-41) || !(b <= 3.7e-50)) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = (x + (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 ((b <= (-6.2d-41)) .or. (.not. (b <= 3.7d-50))) then
tmp = x + (y + (b * (a - 0.5d0)))
else
tmp = (x + (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 ((b <= -6.2e-41) || !(b <= 3.7e-50)) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = (x + (y + z)) - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.2e-41) or not (b <= 3.7e-50): tmp = x + (y + (b * (a - 0.5))) else: tmp = (x + (y + z)) - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6.2e-41) || !(b <= 3.7e-50)) tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); else tmp = Float64(Float64(x + Float64(y + z)) - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -6.2e-41) || ~((b <= 3.7e-50))) tmp = x + (y + (b * (a - 0.5))); else tmp = (x + (y + z)) - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -6.2e-41], N[Not[LessEqual[b, 3.7e-50]], $MachinePrecision]], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.2 \cdot 10^{-41} \lor \neg \left(b \leq 3.7 \cdot 10^{-50}\right):\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + \left(y + z\right)\right) - z \cdot \log t\\
\end{array}
\end{array}
if b < -6.20000000000000001e-41 or 3.7000000000000001e-50 < b Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 90.3%
if -6.20000000000000001e-41 < b < 3.7000000000000001e-50Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in b around 0 95.6%
Final simplification92.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.3e+156) (not (<= z 6.5e+155))) (- (+ x 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 <= -5.3e+156) || !(z <= 6.5e+155)) {
tmp = (x + 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 <= (-5.3d+156)) .or. (.not. (z <= 6.5d+155))) then
tmp = (x + 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 <= -5.3e+156) || !(z <= 6.5e+155)) {
tmp = (x + 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 <= -5.3e+156) or not (z <= 6.5e+155): tmp = (x + 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 <= -5.3e+156) || !(z <= 6.5e+155)) tmp = Float64(Float64(x + z) - Float64(z * log(t))); else tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5.3e+156) || ~((z <= 6.5e+155))) tmp = (x + 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, -5.3e+156], N[Not[LessEqual[z, 6.5e+155]], $MachinePrecision]], N[(N[(x + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{+156} \lor \neg \left(z \leq 6.5 \cdot 10^{+155}\right):\\
\;\;\;\;\left(x + z\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\end{array}
\end{array}
if z < -5.2999999999999998e156 or 6.50000000000000046e155 < z Initial program 99.7%
Taylor expanded in a around 0 99.8%
Taylor expanded in b around 0 81.3%
Taylor expanded in y around 0 69.1%
if -5.2999999999999998e156 < z < 6.50000000000000046e155Initial 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 92.8%
Final simplification87.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))))
(if (<= z -7.8e+155)
(- (+ x z) t_1)
(if (<= z 2.65e+157) (+ x (+ y (* b (- a 0.5)))) (- (+ y z) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double tmp;
if (z <= -7.8e+155) {
tmp = (x + z) - t_1;
} else if (z <= 2.65e+157) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = (y + z) - 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 = z * log(t)
if (z <= (-7.8d+155)) then
tmp = (x + z) - t_1
else if (z <= 2.65d+157) then
tmp = x + (y + (b * (a - 0.5d0)))
else
tmp = (y + z) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * Math.log(t);
double tmp;
if (z <= -7.8e+155) {
tmp = (x + z) - t_1;
} else if (z <= 2.65e+157) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = (y + z) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) tmp = 0 if z <= -7.8e+155: tmp = (x + z) - t_1 elif z <= 2.65e+157: tmp = x + (y + (b * (a - 0.5))) else: tmp = (y + z) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) tmp = 0.0 if (z <= -7.8e+155) tmp = Float64(Float64(x + z) - t_1); elseif (z <= 2.65e+157) tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); else tmp = Float64(Float64(y + z) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); tmp = 0.0; if (z <= -7.8e+155) tmp = (x + z) - t_1; elseif (z <= 2.65e+157) tmp = x + (y + (b * (a - 0.5))); else tmp = (y + z) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e+155], N[(N[(x + z), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 2.65e+157], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + z), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{+155}:\\
\;\;\;\;\left(x + z\right) - t_1\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{+157}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + z\right) - t_1\\
\end{array}
\end{array}
if z < -7.7999999999999996e155Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in b around 0 78.1%
Taylor expanded in y around 0 64.8%
if -7.7999999999999996e155 < z < 2.6499999999999999e157Initial 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 92.8%
if 2.6499999999999999e157 < z Initial program 99.7%
Taylor expanded in x around 0 92.9%
Taylor expanded in b around 0 76.9%
Final simplification88.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.2e+269) (not (<= z 2.8e+157))) (* 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 <= -8.2e+269) || !(z <= 2.8e+157)) {
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 <= (-8.2d+269)) .or. (.not. (z <= 2.8d+157))) 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 <= -8.2e+269) || !(z <= 2.8e+157)) {
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 <= -8.2e+269) or not (z <= 2.8e+157): 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 <= -8.2e+269) || !(z <= 2.8e+157)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.2e+269) || ~((z <= 2.8e+157))) 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, -8.2e+269], N[Not[LessEqual[z, 2.8e+157]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+269} \lor \neg \left(z \leq 2.8 \cdot 10^{+157}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\end{array}
\end{array}
if z < -8.20000000000000015e269 or 2.8000000000000003e157 < z Initial program 99.7%
Taylor expanded in a around 0 99.7%
Taylor expanded in z around inf 69.0%
if -8.20000000000000015e269 < z < 2.8000000000000003e157Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 89.2%
Final simplification86.0%
(FPCore (x y z t a b) :precision binary64 (if (<= z -8.2e+269) (* z (- 1.0 (log t))) (if (<= z 4.3e+157) (+ 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 <= -8.2e+269) {
tmp = z * (1.0 - log(t));
} else if (z <= 4.3e+157) {
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 <= (-8.2d+269)) then
tmp = z * (1.0d0 - log(t))
else if (z <= 4.3d+157) 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 <= -8.2e+269) {
tmp = z * (1.0 - Math.log(t));
} else if (z <= 4.3e+157) {
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 <= -8.2e+269: tmp = z * (1.0 - math.log(t)) elif z <= 4.3e+157: 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 <= -8.2e+269) tmp = Float64(z * Float64(1.0 - log(t))); elseif (z <= 4.3e+157) tmp = Float64(x + Float64(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 <= -8.2e+269) tmp = z * (1.0 - log(t)); elseif (z <= 4.3e+157) 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, -8.2e+269], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e+157], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+269}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+157}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z - z \cdot \log t\\
\end{array}
\end{array}
if z < -8.20000000000000015e269Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around inf 85.5%
if -8.20000000000000015e269 < z < 4.3e157Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 89.2%
if 4.3e157 < z Initial program 99.7%
Taylor expanded in a around 0 99.7%
Taylor expanded in b around 0 83.7%
Taylor expanded in x around 0 76.9%
Simplified76.9%
Taylor expanded in y around 0 65.6%
Final simplification86.1%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -500000.0) (+ x (* -0.5 b)) (if (<= (+ x y) 5000000.0) (* b (- a 0.5)) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -500000.0) {
tmp = x + (-0.5 * b);
} else if ((x + y) <= 5000000.0) {
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 ((x + y) <= (-500000.0d0)) then
tmp = x + ((-0.5d0) * b)
else if ((x + y) <= 5000000.0d0) 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 ((x + y) <= -500000.0) {
tmp = x + (-0.5 * b);
} else if ((x + y) <= 5000000.0) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -500000.0: tmp = x + (-0.5 * b) elif (x + y) <= 5000000.0: tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -500000.0) tmp = Float64(x + Float64(-0.5 * b)); elseif (Float64(x + y) <= 5000000.0) 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 ((x + y) <= -500000.0) tmp = x + (-0.5 * b); elseif ((x + y) <= 5000000.0) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -500000.0], N[(x + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 5000000.0], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -500000:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{elif}\;x + y \leq 5000000:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (+.f64 x y) < -5e5Initial program 100.0%
+-commutative100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
associate--l+100.0%
associate-+l+100.0%
Simplified100.0%
Taylor expanded in y around 0 66.9%
Taylor expanded in z around 0 56.2%
Taylor expanded in a around 0 38.9%
if -5e5 < (+.f64 x y) < 5e6Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 66.4%
if 5e6 < (+.f64 x y) Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in b around 0 75.7%
Taylor expanded in z around 0 58.1%
Final simplification53.3%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -500000.0) (+ x (* -0.5 b)) (if (<= (+ x y) 5000000.0) (* b (- a 0.5)) (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -500000.0) {
tmp = x + (-0.5 * b);
} else if ((x + y) <= 5000000.0) {
tmp = b * (a - 0.5);
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= (-500000.0d0)) then
tmp = x + ((-0.5d0) * b)
else if ((x + y) <= 5000000.0d0) then
tmp = b * (a - 0.5d0)
else
tmp = y + ((-0.5d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -500000.0) {
tmp = x + (-0.5 * b);
} else if ((x + y) <= 5000000.0) {
tmp = b * (a - 0.5);
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -500000.0: tmp = x + (-0.5 * b) elif (x + y) <= 5000000.0: tmp = b * (a - 0.5) else: tmp = y + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -500000.0) tmp = Float64(x + Float64(-0.5 * b)); elseif (Float64(x + y) <= 5000000.0) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(y + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -500000.0) tmp = x + (-0.5 * b); elseif ((x + y) <= 5000000.0) tmp = b * (a - 0.5); else tmp = y + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -500000.0], N[(x + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 5000000.0], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -500000:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{elif}\;x + y \leq 5000000:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\end{array}
if (+.f64 x y) < -5e5Initial program 100.0%
+-commutative100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
associate--l+100.0%
associate-+l+100.0%
Simplified100.0%
Taylor expanded in y around 0 66.9%
Taylor expanded in z around 0 56.2%
Taylor expanded in a around 0 38.9%
if -5e5 < (+.f64 x y) < 5e6Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 66.4%
if 5e6 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 69.6%
Taylor expanded in z around 0 50.8%
Taylor expanded in a around 0 35.6%
Final simplification45.1%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 5000000.0) (+ x (* b (- a 0.5))) (+ y (* -0.5 b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5000000.0) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= 5000000.0d0) then
tmp = x + (b * (a - 0.5d0))
else
tmp = y + ((-0.5d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5000000.0) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 5000000.0: tmp = x + (b * (a - 0.5)) else: tmp = y + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 5000000.0) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(y + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= 5000000.0) tmp = x + (b * (a - 0.5)); else tmp = y + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 5000000.0], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 5000000:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\end{array}
if (+.f64 x y) < 5e6Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in y around 0 81.0%
Taylor expanded in z around 0 61.2%
if 5e6 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 69.6%
Taylor expanded in z around 0 50.8%
Taylor expanded in a around 0 35.6%
Final simplification51.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 5000000.0) (+ x (* b (- a 0.5))) (+ x (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5000000.0) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= 5000000.0d0) then
tmp = x + (b * (a - 0.5d0))
else
tmp = x + (y + ((-0.5d0) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5000000.0) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 5000000.0: tmp = x + (b * (a - 0.5)) else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 5000000.0) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= 5000000.0) tmp = x + (b * (a - 0.5)); else tmp = x + (y + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 5000000.0], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 5000000:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 x y) < 5e6Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in y around 0 81.0%
Taylor expanded in z around 0 61.2%
if 5e6 < (+.f64 x 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 81.6%
Taylor expanded in a around 0 65.0%
Final simplification62.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -500000.0) (+ 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) <= -500000.0) {
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) <= (-500000.0d0)) 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) <= -500000.0) {
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) <= -500000.0: 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) <= -500000.0) 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) <= -500000.0) 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], -500000.0], 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 -500000:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\end{array}
if (+.f64 x y) < -5e5Initial program 100.0%
+-commutative100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
associate--l+100.0%
associate-+l+100.0%
Simplified100.0%
Taylor expanded in y around 0 66.9%
Taylor expanded in z around 0 56.2%
if -5e5 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 81.8%
Taylor expanded in z around 0 57.4%
Final simplification57.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x -920000.0) x (if (<= x -7.3e-292) y (if (<= x 6.6e-181) (* -0.5 b) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -920000.0) {
tmp = x;
} else if (x <= -7.3e-292) {
tmp = y;
} else if (x <= 6.6e-181) {
tmp = -0.5 * b;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-920000.0d0)) then
tmp = x
else if (x <= (-7.3d-292)) then
tmp = y
else if (x <= 6.6d-181) then
tmp = (-0.5d0) * b
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -920000.0) {
tmp = x;
} else if (x <= -7.3e-292) {
tmp = y;
} else if (x <= 6.6e-181) {
tmp = -0.5 * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -920000.0: tmp = x elif x <= -7.3e-292: tmp = y elif x <= 6.6e-181: tmp = -0.5 * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -920000.0) tmp = x; elseif (x <= -7.3e-292) tmp = y; elseif (x <= 6.6e-181) tmp = Float64(-0.5 * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -920000.0) tmp = x; elseif (x <= -7.3e-292) tmp = y; elseif (x <= 6.6e-181) tmp = -0.5 * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -920000.0], x, If[LessEqual[x, -7.3e-292], y, If[LessEqual[x, 6.6e-181], N[(-0.5 * b), $MachinePrecision], y]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -920000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -7.3 \cdot 10^{-292}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-181}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -9.2e5Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 39.9%
if -9.2e5 < x < -7.2999999999999997e-292 or 6.60000000000000018e-181 < 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 27.6%
if -7.2999999999999997e-292 < x < 6.60000000000000018e-181Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 66.7%
Taylor expanded in a around 0 29.3%
Final simplification31.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.2e+107) (not (<= b 2.15e+54))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.2e+107) || !(b <= 2.15e+54)) {
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 <= (-6.2d+107)) .or. (.not. (b <= 2.15d+54))) 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 <= -6.2e+107) || !(b <= 2.15e+54)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.2e+107) or not (b <= 2.15e+54): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6.2e+107) || !(b <= 2.15e+54)) 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 <= -6.2e+107) || ~((b <= 2.15e+54))) 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, -6.2e+107], N[Not[LessEqual[b, 2.15e+54]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.2 \cdot 10^{+107} \lor \neg \left(b \leq 2.15 \cdot 10^{+54}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -6.20000000000000052e107 or 2.14999999999999988e54 < b Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 71.2%
if -6.20000000000000052e107 < b < 2.14999999999999988e54Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in b around 0 86.5%
Taylor expanded in z around 0 59.7%
Final simplification64.1%
(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(x + Float64(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[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + b \cdot \left(a - 0.5\right)\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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 79.9%
Final simplification79.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.25e+144) (not (<= a 2.7e+21))) (* b a) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.25e+144) || !(a <= 2.7e+21)) {
tmp = b * a;
} 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 <= (-1.25d+144)) .or. (.not. (a <= 2.7d+21))) then
tmp = b * a
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 <= -1.25e+144) || !(a <= 2.7e+21)) {
tmp = b * a;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.25e+144) or not (a <= 2.7e+21): tmp = b * a else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.25e+144) || !(a <= 2.7e+21)) tmp = Float64(b * a); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.25e+144) || ~((a <= 2.7e+21))) tmp = b * a; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.25e+144], N[Not[LessEqual[a, 2.7e+21]], $MachinePrecision]], N[(b * a), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+144} \lor \neg \left(a \leq 2.7 \cdot 10^{+21}\right):\\
\;\;\;\;b \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.25e144 or 2.7e21 < 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 61.8%
*-commutative61.8%
Simplified61.8%
if -1.25e144 < a < 2.7e21Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in b around 0 77.7%
Taylor expanded in z around 0 55.4%
Final simplification57.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7.6e-13) x (if (<= x 1.7e-169) (* b a) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.6e-13) {
tmp = x;
} else if (x <= 1.7e-169) {
tmp = b * a;
} 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 <= (-7.6d-13)) then
tmp = x
else if (x <= 1.7d-169) then
tmp = b * a
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 <= -7.6e-13) {
tmp = x;
} else if (x <= 1.7e-169) {
tmp = b * a;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7.6e-13: tmp = x elif x <= 1.7e-169: tmp = b * a else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7.6e-13) tmp = x; elseif (x <= 1.7e-169) tmp = Float64(b * a); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -7.6e-13) tmp = x; elseif (x <= 1.7e-169) tmp = b * a; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7.6e-13], x, If[LessEqual[x, 1.7e-169], N[(b * a), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-169}:\\
\;\;\;\;b \cdot a\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -7.5999999999999999e-13Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 38.3%
if -7.5999999999999999e-13 < x < 1.7e-169Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 44.1%
*-commutative44.1%
Simplified44.1%
if 1.7e-169 < 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 28.5%
Final simplification36.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -900000.0) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -900000.0) {
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 <= (-900000.0d0)) 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 <= -900000.0) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -900000.0: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -900000.0) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -900000.0) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -900000.0], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -900000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -9e5Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 39.9%
if -9e5 < 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 25.7%
Final simplification29.4%
(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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 22.5%
Final simplification22.5%
(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 2023318
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))