
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (+ x (fma z (- 1.0 (log t)) (fma (+ a -0.5) b y))))
double code(double x, double y, double z, double t, double a, double b) {
return x + fma(z, (1.0 - log(t)), fma((a + -0.5), b, y));
}
function code(x, y, z, t, a, b) return Float64(x + fma(z, Float64(1.0 - log(t)), fma(Float64(a + -0.5), b, y))) end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)
\end{array}
Initial program 99.8%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -5e+51)
(+ (+ y (+ x z)) t_1)
(if (<= t_1 2e+173) (+ (+ x y) (* z (- 1.0 (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 (t_1 <= -5e+51) {
tmp = (y + (x + z)) + t_1;
} else if (t_1 <= 2e+173) {
tmp = (x + y) + (z * (1.0 - 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 (t_1 <= (-5d+51)) then
tmp = (y + (x + z)) + t_1
else if (t_1 <= 2d+173) then
tmp = (x + y) + (z * (1.0d0 - 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 (t_1 <= -5e+51) {
tmp = (y + (x + z)) + t_1;
} else if (t_1 <= 2e+173) {
tmp = (x + y) + (z * (1.0 - 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 t_1 <= -5e+51: tmp = (y + (x + z)) + t_1 elif t_1 <= 2e+173: tmp = (x + y) + (z * (1.0 - 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 (t_1 <= -5e+51) tmp = Float64(Float64(y + Float64(x + z)) + t_1); elseif (t_1 <= 2e+173) tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - 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 (t_1 <= -5e+51) tmp = (y + (x + z)) + t_1; elseif (t_1 <= 2e+173) tmp = (x + y) + (z * (1.0 - 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[t$95$1, -5e+51], N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 2e+173], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - 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}\;t_1 \leq -5 \cdot 10^{+51}:\\
\;\;\;\;\left(y + \left(x + z\right)\right) + t_1\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+173}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -5e51Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 86.4%
if -5e51 < (*.f64 (-.f64 a 1/2) b) < 2e173Initial program 99.7%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.8%
*-commutative99.8%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 92.3%
if 2e173 < (*.f64 (-.f64 a 1/2) b) Initial program 100.0%
Taylor expanded in z around 0 92.6%
Final simplification90.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= x -1.4e+117)
(+ (+ y (+ x z)) t_1)
(+ t_1 (- (+ z y) (* z (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (x <= -1.4e+117) {
tmp = (y + (x + z)) + t_1;
} else {
tmp = t_1 + ((z + y) - (z * log(t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (x <= (-1.4d+117)) then
tmp = (y + (x + z)) + t_1
else
tmp = t_1 + ((z + y) - (z * log(t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (x <= -1.4e+117) {
tmp = (y + (x + z)) + t_1;
} else {
tmp = t_1 + ((z + y) - (z * Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if x <= -1.4e+117: tmp = (y + (x + z)) + t_1 else: tmp = t_1 + ((z + y) - (z * math.log(t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (x <= -1.4e+117) tmp = Float64(Float64(y + Float64(x + z)) + t_1); else tmp = Float64(t_1 + Float64(Float64(z + y) - Float64(z * log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (x <= -1.4e+117) tmp = (y + (x + z)) + t_1; else tmp = t_1 + ((z + y) - (z * log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e+117], N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(N[(z + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+117}:\\
\;\;\;\;\left(y + \left(x + z\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\left(z + y\right) - z \cdot \log t\right)\\
\end{array}
\end{array}
if x < -1.39999999999999999e117Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 85.9%
if -1.39999999999999999e117 < x Initial program 99.8%
Taylor expanded in x around 0 84.8%
Final simplification85.0%
(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(x + y) + Float64(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[(x + y), $MachinePrecision] + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b
\end{array}
Initial program 99.8%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.5e+212) (not (<= z 1e+204))) (+ x (* z (- 1.0 (log t)))) (+ (+ y (+ x z)) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.5e+212) || !(z <= 1e+204)) {
tmp = x + (z * (1.0 - log(t)));
} else {
tmp = (y + (x + z)) + (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.5d+212)) .or. (.not. (z <= 1d+204))) then
tmp = x + (z * (1.0d0 - log(t)))
else
tmp = (y + (x + z)) + (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.5e+212) || !(z <= 1e+204)) {
tmp = x + (z * (1.0 - Math.log(t)));
} else {
tmp = (y + (x + z)) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.5e+212) or not (z <= 1e+204): tmp = x + (z * (1.0 - math.log(t))) else: tmp = (y + (x + z)) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.5e+212) || !(z <= 1e+204)) tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(Float64(y + Float64(x + z)) + 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.5e+212) || ~((z <= 1e+204))) tmp = x + (z * (1.0 - log(t))); else tmp = (y + (x + z)) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.5e+212], N[Not[LessEqual[z, 1e+204]], $MachinePrecision]], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+212} \lor \neg \left(z \leq 10^{+204}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(x + z\right)\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -8.49999999999999979e212 or 9.99999999999999989e203 < z Initial program 99.4%
associate--l+99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
*-commutative99.5%
cancel-sign-sub-inv99.5%
distribute-rgt1-in99.8%
*-commutative99.8%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 76.3%
if -8.49999999999999979e212 < z < 9.99999999999999989e203Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 90.6%
Final simplification87.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6e+212) (not (<= z 5.8e+249))) (* z (- 1.0 (log t))) (+ (+ y (+ x z)) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6e+212) || !(z <= 5.8e+249)) {
tmp = z * (1.0 - log(t));
} else {
tmp = (y + (x + z)) + (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 <= (-6d+212)) .or. (.not. (z <= 5.8d+249))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (y + (x + z)) + (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 <= -6e+212) || !(z <= 5.8e+249)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (y + (x + z)) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6e+212) or not (z <= 5.8e+249): tmp = z * (1.0 - math.log(t)) else: tmp = (y + (x + z)) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6e+212) || !(z <= 5.8e+249)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(y + Float64(x + z)) + 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 <= -6e+212) || ~((z <= 5.8e+249))) tmp = z * (1.0 - log(t)); else tmp = (y + (x + z)) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6e+212], N[Not[LessEqual[z, 5.8e+249]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+212} \lor \neg \left(z \leq 5.8 \cdot 10^{+249}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(x + z\right)\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -6e212 or 5.80000000000000034e249 < z Initial program 99.4%
associate--l+99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
*-commutative99.5%
cancel-sign-sub-inv99.5%
distribute-rgt1-in99.7%
*-commutative99.7%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 88.4%
Taylor expanded in x around 0 75.1%
if -6e212 < z < 5.80000000000000034e249Initial program 99.9%
add-cube-cbrt99.8%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 87.7%
Final simplification86.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (or (<= t_1 -5e+65) (not (<= t_1 2e+142))) (+ x t_1) (+ x (+ z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e+65) || !(t_1 <= 2e+142)) {
tmp = x + t_1;
} else {
tmp = x + (z + y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-5d+65)) .or. (.not. (t_1 <= 2d+142))) then
tmp = x + t_1
else
tmp = x + (z + y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e+65) || !(t_1 <= 2e+142)) {
tmp = x + t_1;
} else {
tmp = x + (z + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -5e+65) or not (t_1 <= 2e+142): tmp = x + t_1 else: tmp = x + (z + 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+65) || !(t_1 <= 2e+142)) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(z + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -5e+65) || ~((t_1 <= 2e+142))) tmp = x + t_1; else tmp = x + (z + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+65], N[Not[LessEqual[t$95$1, 2e+142]], $MachinePrecision]], N[(x + t$95$1), $MachinePrecision], N[(x + N[(z + 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^{+65} \lor \neg \left(t_1 \leq 2 \cdot 10^{+142}\right):\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -4.99999999999999973e65 or 2.0000000000000001e142 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in100.0%
*-commutative100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 80.3%
if -4.99999999999999973e65 < (*.f64 (-.f64 a 1/2) b) < 2.0000000000000001e142Initial program 99.8%
add-cube-cbrt99.4%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 72.5%
Taylor expanded in b around 0 65.1%
associate-+r+65.1%
+-commutative65.1%
Simplified65.1%
Final simplification72.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (or (<= t_1 -5e+65) (not (<= t_1 2e+152))) t_1 (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e+65) || !(t_1 <= 2e+152)) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-5d+65)) .or. (.not. (t_1 <= 2d+152))) then
tmp = t_1
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e+65) || !(t_1 <= 2e+152)) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -5e+65) or not (t_1 <= 2e+152): tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -5e+65) || !(t_1 <= 2e+152)) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -5e+65) || ~((t_1 <= 2e+152))) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+65], N[Not[LessEqual[t$95$1, 2e+152]], $MachinePrecision]], t$95$1, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+65} \lor \neg \left(t_1 \leq 2 \cdot 10^{+152}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -4.99999999999999973e65 or 2.0000000000000001e152 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
Taylor expanded in z around 0 86.3%
Taylor expanded in b around inf 73.5%
if -4.99999999999999973e65 < (*.f64 (-.f64 a 1/2) b) < 2.0000000000000001e152Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 63.8%
Final simplification68.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (or (<= t_1 -5e+65) (not (<= t_1 2e+152))) t_1 (+ x (+ z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e+65) || !(t_1 <= 2e+152)) {
tmp = t_1;
} else {
tmp = x + (z + y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-5d+65)) .or. (.not. (t_1 <= 2d+152))) then
tmp = t_1
else
tmp = x + (z + y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e+65) || !(t_1 <= 2e+152)) {
tmp = t_1;
} else {
tmp = x + (z + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -5e+65) or not (t_1 <= 2e+152): tmp = t_1 else: tmp = x + (z + 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+65) || !(t_1 <= 2e+152)) tmp = t_1; else tmp = Float64(x + Float64(z + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -5e+65) || ~((t_1 <= 2e+152))) tmp = t_1; else tmp = x + (z + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+65], N[Not[LessEqual[t$95$1, 2e+152]], $MachinePrecision]], t$95$1, N[(x + N[(z + 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^{+65} \lor \neg \left(t_1 \leq 2 \cdot 10^{+152}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -4.99999999999999973e65 or 2.0000000000000001e152 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
Taylor expanded in z around 0 86.3%
Taylor expanded in b around inf 73.5%
if -4.99999999999999973e65 < (*.f64 (-.f64 a 1/2) b) < 2.0000000000000001e152Initial program 99.8%
add-cube-cbrt99.4%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 72.9%
Taylor expanded in b around 0 64.9%
associate-+r+64.9%
+-commutative64.9%
Simplified64.9%
Final simplification68.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 5e-196) (+ x t_1) (+ t_1 (+ z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 5e-196) {
tmp = x + t_1;
} else {
tmp = t_1 + (z + y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= 5d-196) then
tmp = x + t_1
else
tmp = t_1 + (z + y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 5e-196) {
tmp = x + t_1;
} else {
tmp = t_1 + (z + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= 5e-196: tmp = x + t_1 else: tmp = t_1 + (z + y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= 5e-196) tmp = Float64(x + t_1); else tmp = Float64(t_1 + Float64(z + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= 5e-196) tmp = x + t_1; else tmp = t_1 + (z + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], 5e-196], N[(x + t$95$1), $MachinePrecision], N[(t$95$1 + N[(z + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq 5 \cdot 10^{-196}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(z + y\right)\\
\end{array}
\end{array}
if (+.f64 x y) < 5.0000000000000005e-196Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 63.3%
if 5.0000000000000005e-196 < (+.f64 x y) Initial program 99.8%
add-cube-cbrt99.5%
pow399.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 76.4%
Taylor expanded in x around 0 57.8%
Final simplification60.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -5e-156) (+ 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) <= -5e-156) {
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) <= (-5d-156)) 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) <= -5e-156) {
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) <= -5e-156: 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) <= -5e-156) 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) <= -5e-156) 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], -5e-156], 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 -5 \cdot 10^{-156}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\end{array}
if (+.f64 x y) < -5.00000000000000007e-156Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 62.1%
if -5.00000000000000007e-156 < (+.f64 x y) Initial program 99.8%
Taylor expanded in z around 0 75.8%
Taylor expanded in x around 0 58.7%
Final simplification60.4%
(FPCore (x y z t a b) :precision binary64 (+ (+ y (+ x z)) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return (y + (x + z)) + (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 = (y + (x + z)) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (y + (x + z)) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return (y + (x + z)) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(y + Float64(x + z)) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = (y + (x + z)) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y + \left(x + z\right)\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.8%
add-cube-cbrt99.6%
pow399.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 79.0%
Final simplification79.0%
(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.8%
Taylor expanded in z around 0 78.3%
Final simplification78.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.4e+83) x (if (<= x 7.4e-290) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.4e+83) {
tmp = x;
} else if (x <= 7.4e-290) {
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 <= (-2.4d+83)) then
tmp = x
else if (x <= 7.4d-290) 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 <= -2.4e+83) {
tmp = x;
} else if (x <= 7.4e-290) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.4e+83: tmp = x elif x <= 7.4e-290: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.4e+83) tmp = x; elseif (x <= 7.4e-290) 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 <= -2.4e+83) tmp = x; elseif (x <= 7.4e-290) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.4e+83], x, If[LessEqual[x, 7.4e-290], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+83}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{-290}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -2.39999999999999991e83Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in100.0%
*-commutative100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 58.1%
if -2.39999999999999991e83 < x < 7.39999999999999954e-290Initial program 99.8%
Taylor expanded in z around 0 72.6%
Taylor expanded in a around inf 36.7%
if 7.39999999999999954e-290 < x Initial program 99.8%
add-cube-cbrt99.6%
pow399.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 80.8%
Taylor expanded in y around inf 26.8%
Final simplification36.8%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.3e+124) (* a b) (if (<= b 5.6e+65) (+ x y) (* -0.5 b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.3e+124) {
tmp = a * b;
} else if (b <= 5.6e+65) {
tmp = x + y;
} else {
tmp = -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 (b <= (-1.3d+124)) then
tmp = a * b
else if (b <= 5.6d+65) then
tmp = x + y
else
tmp = (-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 (b <= -1.3e+124) {
tmp = a * b;
} else if (b <= 5.6e+65) {
tmp = x + y;
} else {
tmp = -0.5 * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.3e+124: tmp = a * b elif b <= 5.6e+65: tmp = x + y else: tmp = -0.5 * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.3e+124) tmp = Float64(a * b); elseif (b <= 5.6e+65) tmp = Float64(x + y); else tmp = Float64(-0.5 * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.3e+124) tmp = a * b; elseif (b <= 5.6e+65) tmp = x + y; else tmp = -0.5 * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.3e+124], N[(a * b), $MachinePrecision], If[LessEqual[b, 5.6e+65], N[(x + y), $MachinePrecision], N[(-0.5 * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{+124}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+65}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot b\\
\end{array}
\end{array}
if b < -1.3e124Initial program 99.9%
Taylor expanded in z around 0 89.6%
Taylor expanded in a around inf 50.8%
if -1.3e124 < b < 5.5999999999999998e65Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 55.5%
if 5.5999999999999998e65 < b Initial program 99.9%
associate--l+100.0%
associate-+l+100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
+-commutative100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
distribute-rgt1-in100.0%
*-commutative100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 93.5%
fma-def93.5%
sub-neg93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in a around 0 57.7%
Taylor expanded in b around inf 42.5%
*-commutative42.5%
Simplified42.5%
Final simplification52.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -0.16) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -0.16) {
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 <= (-0.16d0)) 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 <= -0.16) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -0.16: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -0.16) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -0.16) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -0.16], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.16:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -0.160000000000000003Initial program 99.8%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 46.8%
if -0.160000000000000003 < x Initial program 99.8%
add-cube-cbrt99.6%
pow399.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 77.9%
Taylor expanded in y around inf 22.0%
Final simplification29.1%
(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.8%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 23.7%
Final simplification23.7%
(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 2023230
(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)))