
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (+ (* z (- 1.0 (log t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * (1.0 - log(t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * Float64(1.0 - log(t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\end{array}
Initial program 99.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%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -2e+122) (not (<= t_1 1e+93)))
(+ (+ x y) t_1)
(+ x (+ (* z (- 1.0 (log t))) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -2e+122) || !(t_1 <= 1e+93)) {
tmp = (x + y) + t_1;
} else {
tmp = x + ((z * (1.0 - log(t))) + y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-2d+122)) .or. (.not. (t_1 <= 1d+93))) then
tmp = (x + y) + t_1
else
tmp = x + ((z * (1.0d0 - log(t))) + y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -2e+122) || !(t_1 <= 1e+93)) {
tmp = (x + y) + t_1;
} else {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -2e+122) or not (t_1 <= 1e+93): tmp = (x + y) + t_1 else: tmp = x + ((z * (1.0 - math.log(t))) + y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -2e+122) || !(t_1 <= 1e+93)) tmp = Float64(Float64(x + y) + t_1); else tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -2e+122) || ~((t_1 <= 1e+93))) tmp = (x + y) + t_1; else tmp = x + ((z * (1.0 - log(t))) + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+122], N[Not[LessEqual[t$95$1, 1e+93]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+122} \lor \neg \left(t\_1 \leq 10^{+93}\right):\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -2.00000000000000003e122 or 1.00000000000000004e93 < (*.f64 (-.f64 a 1/2) b) Initial program 100.0%
Taylor expanded in z around 0 91.5%
if -2.00000000000000003e122 < (*.f64 (-.f64 a 1/2) b) < 1.00000000000000004e93Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 90.6%
Final simplification91.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -5e+150)
(- (+ z t_1) (* z (log t)))
(if (<= t_1 1e+93) (+ x (+ (* z (- 1.0 (log t))) y)) (+ (+ 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+150) {
tmp = (z + t_1) - (z * log(t));
} else if (t_1 <= 1e+93) {
tmp = x + ((z * (1.0 - log(t))) + y);
} 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+150)) then
tmp = (z + t_1) - (z * log(t))
else if (t_1 <= 1d+93) then
tmp = x + ((z * (1.0d0 - log(t))) + y)
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+150) {
tmp = (z + t_1) - (z * Math.log(t));
} else if (t_1 <= 1e+93) {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
} 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+150: tmp = (z + t_1) - (z * math.log(t)) elif t_1 <= 1e+93: tmp = x + ((z * (1.0 - math.log(t))) + y) 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+150) tmp = Float64(Float64(z + t_1) - Float64(z * log(t))); elseif (t_1 <= 1e+93) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); 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+150) tmp = (z + t_1) - (z * log(t)); elseif (t_1 <= 1e+93) tmp = x + ((z * (1.0 - log(t))) + y); 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+150], N[(N[(z + t$95$1), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+93], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $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^{+150}:\\
\;\;\;\;\left(z + t\_1\right) - z \cdot \log t\\
\mathbf{elif}\;t\_1 \leq 10^{+93}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -5.00000000000000009e150Initial program 100.0%
Taylor expanded in y around 0 96.3%
Taylor expanded in x around 0 93.5%
if -5.00000000000000009e150 < (*.f64 (-.f64 a 1/2) b) < 1.00000000000000004e93Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 90.0%
if 1.00000000000000004e93 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
Taylor expanded in z around 0 91.9%
Final simplification91.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 1e+80) (- (+ x (+ z t_1)) (* z (log t))) (+ (+ x y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 1e+80) {
tmp = (x + (z + t_1)) - (z * log(t));
} else {
tmp = (x + y) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= 1d+80) then
tmp = (x + (z + t_1)) - (z * log(t))
else
tmp = (x + y) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 1e+80) {
tmp = (x + (z + t_1)) - (z * Math.log(t));
} else {
tmp = (x + y) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= 1e+80: tmp = (x + (z + t_1)) - (z * math.log(t)) else: tmp = (x + y) + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= 1e+80) tmp = Float64(Float64(x + Float64(z + t_1)) - Float64(z * log(t))); else tmp = Float64(Float64(x + y) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= 1e+80) tmp = (x + (z + t_1)) - (z * log(t)); else tmp = (x + y) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], 1e+80], N[(N[(x + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq 10^{+80}:\\
\;\;\;\;\left(x + \left(z + t\_1\right)\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < 1e80Initial program 99.8%
Taylor expanded in y around 0 84.2%
if 1e80 < (+.f64 x y) Initial program 99.9%
Taylor expanded in z around 0 86.1%
Final simplification84.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6e+197) (not (<= z 1.5e+248))) (* 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 <= -6e+197) || !(z <= 1.5e+248)) {
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 <= (-6d+197)) .or. (.not. (z <= 1.5d+248))) 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 <= -6e+197) || !(z <= 1.5e+248)) {
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 <= -6e+197) or not (z <= 1.5e+248): 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 <= -6e+197) || !(z <= 1.5e+248)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6e+197) || ~((z <= 1.5e+248))) 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, -6e+197], N[Not[LessEqual[z, 1.5e+248]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+197} \lor \neg \left(z \leq 1.5 \cdot 10^{+248}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -6.0000000000000004e197 or 1.5e248 < z Initial program 99.4%
Taylor expanded in y around 0 95.1%
Taylor expanded in z around inf 74.0%
if -6.0000000000000004e197 < z < 1.5e248Initial program 99.9%
Taylor expanded in z around 0 86.5%
Final simplification84.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -4e+190)
(+ t_1 x)
(if (<= z 1.42e+248) (+ (+ x y) (* b (- a 0.5))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - log(t));
double tmp;
if (z <= -4e+190) {
tmp = t_1 + x;
} else if (z <= 1.42e+248) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = 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 * (1.0d0 - log(t))
if (z <= (-4d+190)) then
tmp = t_1 + x
else if (z <= 1.42d+248) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = 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 * (1.0 - Math.log(t));
double tmp;
if (z <= -4e+190) {
tmp = t_1 + x;
} else if (z <= 1.42e+248) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -4e+190: tmp = t_1 + x elif z <= 1.42e+248: tmp = (x + y) + (b * (a - 0.5)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -4e+190) tmp = Float64(t_1 + x); elseif (z <= 1.42e+248) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (1.0 - log(t)); tmp = 0.0; if (z <= -4e+190) tmp = t_1 + x; elseif (z <= 1.42e+248) tmp = (x + y) + (b * (a - 0.5)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+190], N[(t$95$1 + x), $MachinePrecision], If[LessEqual[z, 1.42e+248], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -4 \cdot 10^{+190}:\\
\;\;\;\;t\_1 + x\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{+248}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.0000000000000003e190Initial program 99.5%
Taylor expanded in y around 0 96.7%
Taylor expanded in b around 0 72.3%
*-commutative72.3%
associate-+r-72.3%
cancel-sign-sub-inv72.3%
*-lft-identity72.3%
distribute-rgt-in72.4%
sub-neg72.4%
Simplified72.4%
if -4.0000000000000003e190 < z < 1.42e248Initial program 99.9%
Taylor expanded in z around 0 86.5%
if 1.42e248 < z Initial program 99.3%
Taylor expanded in y around 0 89.3%
Taylor expanded in z around inf 89.3%
Final simplification84.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.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.5e+55)
(* a b)
(if (<= a 2.55e-132)
y
(if (<= a 4.2e-34) (* -0.5 b) (if (<= a 6.8e+16) x (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.5e+55) {
tmp = a * b;
} else if (a <= 2.55e-132) {
tmp = y;
} else if (a <= 4.2e-34) {
tmp = -0.5 * b;
} else if (a <= 6.8e+16) {
tmp = x;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-2.5d+55)) then
tmp = a * b
else if (a <= 2.55d-132) then
tmp = y
else if (a <= 4.2d-34) then
tmp = (-0.5d0) * b
else if (a <= 6.8d+16) then
tmp = x
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.5e+55) {
tmp = a * b;
} else if (a <= 2.55e-132) {
tmp = y;
} else if (a <= 4.2e-34) {
tmp = -0.5 * b;
} else if (a <= 6.8e+16) {
tmp = x;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.5e+55: tmp = a * b elif a <= 2.55e-132: tmp = y elif a <= 4.2e-34: tmp = -0.5 * b elif a <= 6.8e+16: tmp = x else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.5e+55) tmp = Float64(a * b); elseif (a <= 2.55e-132) tmp = y; elseif (a <= 4.2e-34) tmp = Float64(-0.5 * b); elseif (a <= 6.8e+16) tmp = x; else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.5e+55) tmp = a * b; elseif (a <= 2.55e-132) tmp = y; elseif (a <= 4.2e-34) tmp = -0.5 * b; elseif (a <= 6.8e+16) tmp = x; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.5e+55], N[(a * b), $MachinePrecision], If[LessEqual[a, 2.55e-132], y, If[LessEqual[a, 4.2e-34], N[(-0.5 * b), $MachinePrecision], If[LessEqual[a, 6.8e+16], x, N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+55}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \leq 2.55 \cdot 10^{-132}:\\
\;\;\;\;y\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-34}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{+16}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if a < -2.50000000000000023e55 or 6.8e16 < 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 55.8%
*-commutative55.8%
Simplified55.8%
if -2.50000000000000023e55 < a < 2.55000000000000003e-132Initial 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 29.2%
if 2.55000000000000003e-132 < a < 4.2000000000000002e-34Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 30.5%
Taylor expanded in a around 0 30.5%
*-commutative30.5%
Simplified30.5%
if 4.2000000000000002e-34 < a < 6.8e16Initial 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.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 21.6%
Final simplification41.0%
(FPCore (x y z t a b) :precision binary64 (if (<= b -5.5e+225) (* -0.5 b) (if (or (<= b -2e+56) (not (<= b 1.3e+47))) (* a b) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.5e+225) {
tmp = -0.5 * b;
} else if ((b <= -2e+56) || !(b <= 1.3e+47)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-5.5d+225)) then
tmp = (-0.5d0) * b
else if ((b <= (-2d+56)) .or. (.not. (b <= 1.3d+47))) then
tmp = a * b
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.5e+225) {
tmp = -0.5 * b;
} else if ((b <= -2e+56) || !(b <= 1.3e+47)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -5.5e+225: tmp = -0.5 * b elif (b <= -2e+56) or not (b <= 1.3e+47): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5.5e+225) tmp = Float64(-0.5 * b); elseif ((b <= -2e+56) || !(b <= 1.3e+47)) tmp = Float64(a * b); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -5.5e+225) tmp = -0.5 * b; elseif ((b <= -2e+56) || ~((b <= 1.3e+47))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5.5e+225], N[(-0.5 * b), $MachinePrecision], If[Or[LessEqual[b, -2e+56], N[Not[LessEqual[b, 1.3e+47]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{+225}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;b \leq -2 \cdot 10^{+56} \lor \neg \left(b \leq 1.3 \cdot 10^{+47}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -5.49999999999999985e225Initial 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 89.3%
Taylor expanded in a around 0 59.6%
*-commutative59.6%
Simplified59.6%
if -5.49999999999999985e225 < b < -2.00000000000000018e56 or 1.30000000000000002e47 < b Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 50.2%
*-commutative50.2%
Simplified50.2%
if -2.00000000000000018e56 < b < 1.30000000000000002e47Initial program 99.8%
Taylor expanded in z around 0 69.1%
Taylor expanded in b around 0 57.0%
+-commutative57.0%
Simplified57.0%
Final simplification54.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.2e+50) (not (<= b 800000.0))) (+ x (* b (- a 0.5))) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.2e+50) || !(b <= 800000.0)) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-4.2d+50)) .or. (.not. (b <= 800000.0d0))) then
tmp = x + (b * (a - 0.5d0))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.2e+50) || !(b <= 800000.0)) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -4.2e+50) or not (b <= 800000.0): tmp = x + (b * (a - 0.5)) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.2e+50) || !(b <= 800000.0)) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -4.2e+50) || ~((b <= 800000.0))) tmp = x + (b * (a - 0.5)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.2e+50], N[Not[LessEqual[b, 800000.0]], $MachinePrecision]], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.2 \cdot 10^{+50} \lor \neg \left(b \leq 800000\right):\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -4.1999999999999999e50 or 8e5 < b Initial program 99.9%
Taylor expanded in y around 0 89.0%
Taylor expanded in z around 0 75.1%
if -4.1999999999999999e50 < b < 8e5Initial program 99.8%
Taylor expanded in z around 0 68.8%
Taylor expanded in b around 0 57.6%
+-commutative57.6%
Simplified57.6%
Final simplification66.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.3e+51) (not (<= b 1.55e+47))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.3e+51) || !(b <= 1.55e+47)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.3d+51)) .or. (.not. (b <= 1.55d+47))) then
tmp = b * (a - 0.5d0)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.3e+51) || !(b <= 1.55e+47)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.3e+51) or not (b <= 1.55e+47): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.3e+51) || !(b <= 1.55e+47)) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.3e+51) || ~((b <= 1.55e+47))) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.3e+51], N[Not[LessEqual[b, 1.55e+47]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{+51} \lor \neg \left(b \leq 1.55 \cdot 10^{+47}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -1.3000000000000001e51 or 1.55e47 < b Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 72.1%
if -1.3000000000000001e51 < b < 1.55e47Initial program 99.8%
Taylor expanded in z around 0 69.1%
Taylor expanded in b around 0 57.0%
+-commutative57.0%
Simplified57.0%
Final simplification63.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -1e-116) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -1e-116) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= (-1d-116)) then
tmp = x + t_1
else
tmp = y + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -1e-116) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= -1e-116: tmp = x + t_1 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -1e-116) tmp = Float64(x + t_1); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -1e-116) tmp = x + t_1; else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -1e-116], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -1 \cdot 10^{-116}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -9.9999999999999999e-117Initial program 99.8%
Taylor expanded in y around 0 77.7%
Taylor expanded in z around 0 52.9%
if -9.9999999999999999e-117 < (+.f64 x y) Initial program 99.8%
add-cbrt-cube67.4%
pow367.4%
Applied egg-rr67.4%
add-cbrt-cube41.1%
pow341.1%
rem-cbrt-cube40.6%
associate--l+40.6%
*-commutative40.6%
Applied egg-rr40.6%
Taylor expanded in y around inf 62.6%
Final simplification58.3%
(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 76.6%
Final simplification76.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.1e+37) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.1e+37) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 2.1d+37) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.1e+37) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.1e+37: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.1e+37) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.1e+37) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.1e+37], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{+37}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.1000000000000001e37Initial 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 x around inf 23.0%
if 2.1000000000000001e37 < 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 y around inf 45.5%
Final simplification27.9%
(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%
+-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 x around inf 19.6%
Final simplification19.6%
(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 2024036
(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)))