
(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 9 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) (* 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}
Initial program 99.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b)) (t_2 (+ (+ x y) z)) (t_3 (+ t_2 t_1))) (if (<= t_1 -5e+96) t_3 (if (<= t_1 2e+125) (- t_2 (* z (log t))) t_3))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = (x + y) + z;
double t_3 = t_2 + t_1;
double tmp;
if (t_1 <= -5e+96) {
tmp = t_3;
} else if (t_1 <= 2e+125) {
tmp = t_2 - (z * log(t));
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (a - 0.5d0) * b
t_2 = (x + y) + z
t_3 = t_2 + t_1
if (t_1 <= (-5d+96)) then
tmp = t_3
else if (t_1 <= 2d+125) then
tmp = t_2 - (z * log(t))
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = (x + y) + z;
double t_3 = t_2 + t_1;
double tmp;
if (t_1 <= -5e+96) {
tmp = t_3;
} else if (t_1 <= 2e+125) {
tmp = t_2 - (z * Math.log(t));
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b t_2 = (x + y) + z t_3 = t_2 + t_1 tmp = 0 if t_1 <= -5e+96: tmp = t_3 elif t_1 <= 2e+125: tmp = t_2 - (z * math.log(t)) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) t_2 = Float64(Float64(x + y) + z) t_3 = Float64(t_2 + t_1) tmp = 0.0 if (t_1 <= -5e+96) tmp = t_3; elseif (t_1 <= 2e+125) tmp = Float64(t_2 - Float64(z * log(t))); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; t_2 = (x + y) + z; t_3 = t_2 + t_1; tmp = 0.0; if (t_1 <= -5e+96) tmp = t_3; elseif (t_1 <= 2e+125) tmp = t_2 - (z * log(t)); else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + t$95$1), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+96], t$95$3, If[LessEqual[t$95$1, 2e+125], N[(t$95$2 - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := \left(x + y\right) + z\\
t_3 := t\_2 + t\_1\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+96}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+125}:\\
\;\;\;\;t\_2 - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000004e96 or 1.9999999999999998e125 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites93.2%
if -5.0000000000000004e96 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.9999999999999998e125Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites92.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b)) (t_2 (+ (+ t_1 z) z))) (if (<= t_1 -5e+96) t_2 (if (<= t_1 2e+144) (+ (+ x y) z) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = (t_1 + z) + z;
double tmp;
if (t_1 <= -5e+96) {
tmp = t_2;
} else if (t_1 <= 2e+144) {
tmp = (x + y) + z;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a - 0.5d0) * b
t_2 = (t_1 + z) + z
if (t_1 <= (-5d+96)) then
tmp = t_2
else if (t_1 <= 2d+144) then
tmp = (x + y) + z
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = (t_1 + z) + z;
double tmp;
if (t_1 <= -5e+96) {
tmp = t_2;
} else if (t_1 <= 2e+144) {
tmp = (x + y) + z;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b t_2 = (t_1 + z) + z tmp = 0 if t_1 <= -5e+96: tmp = t_2 elif t_1 <= 2e+144: tmp = (x + y) + z else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) t_2 = Float64(Float64(t_1 + z) + z) tmp = 0.0 if (t_1 <= -5e+96) tmp = t_2; elseif (t_1 <= 2e+144) tmp = Float64(Float64(x + y) + z); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; t_2 = (t_1 + z) + z; tmp = 0.0; if (t_1 <= -5e+96) tmp = t_2; elseif (t_1 <= 2e+144) tmp = (x + y) + z; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + z), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+96], t$95$2, If[LessEqual[t$95$1, 2e+144], N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := \left(t\_1 + z\right) + z\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+96}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+144}:\\
\;\;\;\;\left(x + y\right) + z\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000004e96 or 2.00000000000000005e144 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites22.0%
Taylor expanded in x around 0
Applied rewrites15.6%
Taylor expanded in x around 0
Applied rewrites80.0%
if -5.0000000000000004e96 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.00000000000000005e144Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites92.3%
Taylor expanded in x around 0
Applied rewrites63.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b)) (t_2 (+ t_1 z))) (if (<= t_1 -5e+96) t_2 (if (<= t_1 2e+144) (+ (+ x y) z) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = t_1 + z;
double tmp;
if (t_1 <= -5e+96) {
tmp = t_2;
} else if (t_1 <= 2e+144) {
tmp = (x + y) + z;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a - 0.5d0) * b
t_2 = t_1 + z
if (t_1 <= (-5d+96)) then
tmp = t_2
else if (t_1 <= 2d+144) then
tmp = (x + y) + z
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = t_1 + z;
double tmp;
if (t_1 <= -5e+96) {
tmp = t_2;
} else if (t_1 <= 2e+144) {
tmp = (x + y) + z;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b t_2 = t_1 + z tmp = 0 if t_1 <= -5e+96: tmp = t_2 elif t_1 <= 2e+144: tmp = (x + y) + z else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) t_2 = Float64(t_1 + z) tmp = 0.0 if (t_1 <= -5e+96) tmp = t_2; elseif (t_1 <= 2e+144) tmp = Float64(Float64(x + y) + z); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; t_2 = t_1 + z; tmp = 0.0; if (t_1 <= -5e+96) tmp = t_2; elseif (t_1 <= 2e+144) tmp = (x + y) + z; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + z), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+96], t$95$2, If[LessEqual[t$95$1, 2e+144], N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := t\_1 + z\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+96}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+144}:\\
\;\;\;\;\left(x + y\right) + z\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000004e96 or 2.00000000000000005e144 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites22.0%
Taylor expanded in x around 0
Applied rewrites87.0%
Taylor expanded in x around 0
Applied rewrites80.0%
if -5.0000000000000004e96 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.00000000000000005e144Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites92.3%
Taylor expanded in x around 0
Applied rewrites63.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b))) (if (<= t_1 -5e+96) t_1 (if (<= t_1 2e+144) (+ (+ x y) z) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -5e+96) {
tmp = t_1;
} else if (t_1 <= 2e+144) {
tmp = (x + y) + z;
} 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 = (a - 0.5d0) * b
if (t_1 <= (-5d+96)) then
tmp = t_1
else if (t_1 <= 2d+144) then
tmp = (x + y) + z
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 = (a - 0.5) * b;
double tmp;
if (t_1 <= -5e+96) {
tmp = t_1;
} else if (t_1 <= 2e+144) {
tmp = (x + y) + z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b tmp = 0 if t_1 <= -5e+96: tmp = t_1 elif t_1 <= 2e+144: tmp = (x + y) + z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_1 <= -5e+96) tmp = t_1; elseif (t_1 <= 2e+144) tmp = Float64(Float64(x + y) + z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; tmp = 0.0; if (t_1 <= -5e+96) tmp = t_1; elseif (t_1 <= 2e+144) tmp = (x + y) + z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+96], t$95$1, If[LessEqual[t$95$1, 2e+144], N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+144}:\\
\;\;\;\;\left(x + y\right) + z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000004e96 or 2.00000000000000005e144 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites22.0%
Taylor expanded in x around 0
Applied rewrites87.0%
Taylor expanded in x around inf
Applied rewrites79.4%
if -5.0000000000000004e96 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.00000000000000005e144Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites92.3%
Taylor expanded in x around 0
Applied rewrites63.9%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) z) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + z) + ((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) + ((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) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + z) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + z) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + z) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + z\right) + \left(a - 0.5\right) \cdot b
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites80.1%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + y) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (x + y) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + \left(a - 0.5\right) \cdot b
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites79.3%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) z))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + z;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + z;
}
def code(x, y, z, t, a, b): return (x + y) + z
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + z) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + z; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + z
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites63.8%
Taylor expanded in x around 0
Applied rewrites44.3%
(FPCore (x y z t a b) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a, double b) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + y;
}
def code(x, y, z, t, a, b): return x + y
function code(x, y, z, t, a, b) return Float64(x + y) end
function tmp = code(x, y, z, t, a, b) tmp = x + y; end
code[x_, y_, z_, t_, a_, b_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites63.8%
Taylor expanded in x around 0
Applied rewrites43.3%
(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 2024321
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:pre (TRUE)
:alt
(! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))