
(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 10 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 (+ (+ x y) z)) (t_2 (* (- a 0.5) b)) (t_3 (+ (+ t_1 t_2) z)))
(if (<= t_2 -2.3e+125)
t_3
(if (<= t_2 3.6e+44) (- t_1 (* z (log t))) t_3))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + z;
double t_2 = (a - 0.5) * b;
double t_3 = (t_1 + t_2) + z;
double tmp;
if (t_2 <= -2.3e+125) {
tmp = t_3;
} else if (t_2 <= 3.6e+44) {
tmp = t_1 - (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 = (x + y) + z
t_2 = (a - 0.5d0) * b
t_3 = (t_1 + t_2) + z
if (t_2 <= (-2.3d+125)) then
tmp = t_3
else if (t_2 <= 3.6d+44) then
tmp = t_1 - (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 = (x + y) + z;
double t_2 = (a - 0.5) * b;
double t_3 = (t_1 + t_2) + z;
double tmp;
if (t_2 <= -2.3e+125) {
tmp = t_3;
} else if (t_2 <= 3.6e+44) {
tmp = t_1 - (z * Math.log(t));
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) + z t_2 = (a - 0.5) * b t_3 = (t_1 + t_2) + z tmp = 0 if t_2 <= -2.3e+125: tmp = t_3 elif t_2 <= 3.6e+44: tmp = t_1 - (z * math.log(t)) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + z) t_2 = Float64(Float64(a - 0.5) * b) t_3 = Float64(Float64(t_1 + t_2) + z) tmp = 0.0 if (t_2 <= -2.3e+125) tmp = t_3; elseif (t_2 <= 3.6e+44) tmp = Float64(t_1 - Float64(z * log(t))); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) + z; t_2 = (a - 0.5) * b; t_3 = (t_1 + t_2) + z; tmp = 0.0; if (t_2 <= -2.3e+125) tmp = t_3; elseif (t_2 <= 3.6e+44) tmp = t_1 - (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[(x + y), $MachinePrecision] + z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 + t$95$2), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[t$95$2, -2.3e+125], t$95$3, If[LessEqual[t$95$2, 3.6e+44], N[(t$95$1 - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + z\\
t_2 := \left(a - 0.5\right) \cdot b\\
t_3 := \left(t\_1 + t\_2\right) + z\\
\mathbf{if}\;t\_2 \leq -2.3 \cdot 10^{+125}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 3.6 \cdot 10^{+44}:\\
\;\;\;\;t\_1 - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2.30000000000000013e125 or 3.6e44 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites91.3%
Taylor expanded in x around 0
Applied rewrites53.7%
Taylor expanded in x around 0
Applied rewrites91.3%
if -2.30000000000000013e125 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 3.6e44Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites92.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b)))
(if (<= t_1 -1.42e+114)
(+ t_1 z)
(if (<= t_1 3.5e+199) (+ (+ (+ x y) z) 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 <= -1.42e+114) {
tmp = t_1 + z;
} else if (t_1 <= 3.5e+199) {
tmp = ((x + y) + z) + 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 <= (-1.42d+114)) then
tmp = t_1 + z
else if (t_1 <= 3.5d+199) then
tmp = ((x + y) + z) + 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 <= -1.42e+114) {
tmp = t_1 + z;
} else if (t_1 <= 3.5e+199) {
tmp = ((x + y) + z) + 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 <= -1.42e+114: tmp = t_1 + z elif t_1 <= 3.5e+199: tmp = ((x + y) + z) + 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 <= -1.42e+114) tmp = Float64(t_1 + z); elseif (t_1 <= 3.5e+199) tmp = Float64(Float64(Float64(x + y) + z) + 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 <= -1.42e+114) tmp = t_1 + z; elseif (t_1 <= 3.5e+199) tmp = ((x + y) + z) + 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, -1.42e+114], N[(t$95$1 + z), $MachinePrecision], If[LessEqual[t$95$1, 3.5e+199], N[(N[(N[(x + y), $MachinePrecision] + z), $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 -1.42 \cdot 10^{+114}:\\
\;\;\;\;t\_1 + z\\
\mathbf{elif}\;t\_1 \leq 3.5 \cdot 10^{+199}:\\
\;\;\;\;\left(\left(x + y\right) + z\right) + z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.4200000000000001e114Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites88.3%
Taylor expanded in x around 0
Applied rewrites55.9%
Taylor expanded in x around 0
Applied rewrites88.3%
Taylor expanded in y around 0
Applied rewrites74.2%
if -1.4200000000000001e114 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 3.49999999999999981e199Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites74.8%
Taylor expanded in x around 0
Applied rewrites65.0%
Taylor expanded in x around 0
Applied rewrites74.8%
Taylor expanded in x around 0
Applied rewrites63.3%
if 3.49999999999999981e199 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites98.2%
Taylor expanded in x around 0
Applied rewrites48.8%
Taylor expanded in x around inf
Applied rewrites86.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b)))
(if (<= t_1 -1.42e+114)
t_1
(if (<= t_1 3.5e+199) (+ (+ (+ x y) z) 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 <= -1.42e+114) {
tmp = t_1;
} else if (t_1 <= 3.5e+199) {
tmp = ((x + y) + z) + 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 <= (-1.42d+114)) then
tmp = t_1
else if (t_1 <= 3.5d+199) then
tmp = ((x + y) + z) + 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 <= -1.42e+114) {
tmp = t_1;
} else if (t_1 <= 3.5e+199) {
tmp = ((x + y) + z) + 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 <= -1.42e+114: tmp = t_1 elif t_1 <= 3.5e+199: tmp = ((x + y) + z) + 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 <= -1.42e+114) tmp = t_1; elseif (t_1 <= 3.5e+199) tmp = Float64(Float64(Float64(x + y) + z) + 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 <= -1.42e+114) tmp = t_1; elseif (t_1 <= 3.5e+199) tmp = ((x + y) + z) + 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, -1.42e+114], t$95$1, If[LessEqual[t$95$1, 3.5e+199], N[(N[(N[(x + y), $MachinePrecision] + z), $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 -1.42 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 3.5 \cdot 10^{+199}:\\
\;\;\;\;\left(\left(x + y\right) + z\right) + z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.4200000000000001e114 or 3.49999999999999981e199 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites92.3%
Taylor expanded in x around 0
Applied rewrites53.0%
Taylor expanded in x around inf
Applied rewrites78.5%
if -1.4200000000000001e114 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 3.49999999999999981e199Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites74.8%
Taylor expanded in x around 0
Applied rewrites65.0%
Taylor expanded in x around 0
Applied rewrites74.8%
Taylor expanded in x around 0
Applied rewrites63.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b))) (if (<= t_1 -1.42e+114) t_1 (if (<= t_1 3.5e+199) (+ (+ 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 <= -1.42e+114) {
tmp = t_1;
} else if (t_1 <= 3.5e+199) {
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 <= (-1.42d+114)) then
tmp = t_1
else if (t_1 <= 3.5d+199) 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 <= -1.42e+114) {
tmp = t_1;
} else if (t_1 <= 3.5e+199) {
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 <= -1.42e+114: tmp = t_1 elif t_1 <= 3.5e+199: 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 <= -1.42e+114) tmp = t_1; elseif (t_1 <= 3.5e+199) 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 <= -1.42e+114) tmp = t_1; elseif (t_1 <= 3.5e+199) 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, -1.42e+114], t$95$1, If[LessEqual[t$95$1, 3.5e+199], 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 -1.42 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 3.5 \cdot 10^{+199}:\\
\;\;\;\;\left(x + y\right) + z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.4200000000000001e114 or 3.49999999999999981e199 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites92.3%
Taylor expanded in x around 0
Applied rewrites53.0%
Taylor expanded in x around inf
Applied rewrites78.5%
if -1.4200000000000001e114 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 3.49999999999999981e199Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites88.3%
Taylor expanded in x around 0
Applied rewrites63.3%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ (+ x y) z) (* (- a 0.5) b)) z))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) + ((a - 0.5) * b)) + 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) + ((a - 0.5d0) * b)) + z
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)) + z;
}
def code(x, y, z, t, a, b): return (((x + y) + z) + ((a - 0.5) * b)) + z
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) + Float64(Float64(a - 0.5) * b)) + z) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) + ((a - 0.5) * b)) + z; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) + \left(a - 0.5\right) \cdot b\right) + z
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites81.8%
Taylor expanded in x around 0
Applied rewrites60.2%
Taylor expanded in x around 0
Applied rewrites81.8%
(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 rewrites81.8%
(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 rewrites81.1%
(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 rewrites62.1%
Taylor expanded in x around 0
Applied rewrites44.5%
(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 rewrites62.1%
Taylor expanded in x around 0
Applied rewrites43.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 2024313
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
: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)))