
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}
Initial program 58.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
(t_2 (* (+ (* (+ (* x y) z) y) 27464.7644705) y))
(t_3 (/ (+ t_2 t) t_1)))
(if (<= t -3.4e-81)
t_3
(if (<= t 8e-55) (/ (* (+ t_2 230661.510616) y) t_1) t_3))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((((((y + a) * y) + b) * y) + c) * y) + i;
double t_2 = ((((x * y) + z) * y) + 27464.7644705) * y;
double t_3 = (t_2 + t) / t_1;
double tmp;
if (t <= -3.4e-81) {
tmp = t_3;
} else if (t <= 8e-55) {
tmp = ((t_2 + 230661.510616) * y) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = ((((((y + a) * y) + b) * y) + c) * y) + i
t_2 = ((((x * y) + z) * y) + 27464.7644705d0) * y
t_3 = (t_2 + t) / t_1
if (t <= (-3.4d-81)) then
tmp = t_3
else if (t <= 8d-55) then
tmp = ((t_2 + 230661.510616d0) * y) / t_1
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 c, double i) {
double t_1 = ((((((y + a) * y) + b) * y) + c) * y) + i;
double t_2 = ((((x * y) + z) * y) + 27464.7644705) * y;
double t_3 = (t_2 + t) / t_1;
double tmp;
if (t <= -3.4e-81) {
tmp = t_3;
} else if (t <= 8e-55) {
tmp = ((t_2 + 230661.510616) * y) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((((((y + a) * y) + b) * y) + c) * y) + i t_2 = ((((x * y) + z) * y) + 27464.7644705) * y t_3 = (t_2 + t) / t_1 tmp = 0 if t <= -3.4e-81: tmp = t_3 elif t <= 8e-55: tmp = ((t_2 + 230661.510616) * y) / t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i) t_2 = Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) t_3 = Float64(Float64(t_2 + t) / t_1) tmp = 0.0 if (t <= -3.4e-81) tmp = t_3; elseif (t <= 8e-55) tmp = Float64(Float64(Float64(t_2 + 230661.510616) * y) / t_1); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((((((y + a) * y) + b) * y) + c) * y) + i; t_2 = ((((x * y) + z) * y) + 27464.7644705) * y; t_3 = (t_2 + t) / t_1; tmp = 0.0; if (t <= -3.4e-81) tmp = t_3; elseif (t <= 8e-55) tmp = ((t_2 + 230661.510616) * y) / t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 + t), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t, -3.4e-81], t$95$3, If[LessEqual[t, 8e-55], N[(N[(N[(t$95$2 + 230661.510616), $MachinePrecision] * y), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i\\
t_2 := \left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y\\
t_3 := \frac{t\_2 + t}{t\_1}\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-81}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-55}:\\
\;\;\;\;\frac{\left(t\_2 + 230661.510616\right) \cdot y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if t < -3.3999999999999999e-81 or 7.99999999999999996e-55 < t Initial program 55.3%
Taylor expanded in x around 0
Applied rewrites48.6%
if -3.3999999999999999e-81 < t < 7.99999999999999996e-55Initial program 64.5%
Taylor expanded in x around 0
Applied rewrites49.5%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* (+ (* (+ y a) y) b) y)) (t_2 (+ (* (+ t_1 c) y) i))) (if (<= z 4.2e+157) (/ (+ (* (+ (* x y) z) y) t) t_2) (/ (+ t_1 t) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((y + a) * y) + b) * y;
double t_2 = ((t_1 + c) * y) + i;
double tmp;
if (z <= 4.2e+157) {
tmp = ((((x * y) + z) * y) + t) / t_2;
} else {
tmp = (t_1 + t) / t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (((y + a) * y) + b) * y
t_2 = ((t_1 + c) * y) + i
if (z <= 4.2d+157) then
tmp = ((((x * y) + z) * y) + t) / t_2
else
tmp = (t_1 + t) / 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 c, double i) {
double t_1 = (((y + a) * y) + b) * y;
double t_2 = ((t_1 + c) * y) + i;
double tmp;
if (z <= 4.2e+157) {
tmp = ((((x * y) + z) * y) + t) / t_2;
} else {
tmp = (t_1 + t) / t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (((y + a) * y) + b) * y t_2 = ((t_1 + c) * y) + i tmp = 0 if z <= 4.2e+157: tmp = ((((x * y) + z) * y) + t) / t_2 else: tmp = (t_1 + t) / t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(y + a) * y) + b) * y) t_2 = Float64(Float64(Float64(t_1 + c) * y) + i) tmp = 0.0 if (z <= 4.2e+157) tmp = Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + t) / t_2); else tmp = Float64(Float64(t_1 + t) / t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (((y + a) * y) + b) * y; t_2 = ((t_1 + c) * y) + i; tmp = 0.0; if (z <= 4.2e+157) tmp = ((((x * y) + z) * y) + t) / t_2; else tmp = (t_1 + t) / t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]}, If[LessEqual[z, 4.2e+157], N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(t$95$1 + t), $MachinePrecision] / t$95$2), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + a\right) \cdot y + b\right) \cdot y\\
t_2 := \left(t\_1 + c\right) \cdot y + i\\
\mathbf{if}\;z \leq 4.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{\left(x \cdot y + z\right) \cdot y + t}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 + t}{t\_2}\\
\end{array}
\end{array}
if z < 4.2e157Initial program 59.9%
Taylor expanded in x around 0
Applied rewrites39.7%
Taylor expanded in x around inf
Applied rewrites34.9%
if 4.2e157 < z Initial program 51.8%
Taylor expanded in x around 0
Applied rewrites31.9%
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((x * y) + z) * y) + 27464.7644705) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = ((((((x * y) + z) * y) + 27464.7644705d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((x * y) + z) * y) + 27464.7644705) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((((x * y) + z) * y) + 27464.7644705) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((((x * y) + z) * y) + 27464.7644705) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}
Initial program 58.9%
Taylor expanded in x around 0
Applied rewrites38.8%
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* x y) z) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((x * y) + z) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = ((((x * y) + z) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((x * y) + z) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((x * y) + z) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((x * y) + z) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y + z\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}
Initial program 58.9%
Taylor expanded in x around 0
Applied rewrites38.8%
Taylor expanded in x around inf
Applied rewrites32.1%
(FPCore (x y z t a b c i) :precision binary64 (/ (* (+ (* x y) z) y) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + z) * y) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + z) * y) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + z) * y) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + z) * y) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + z) * y) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + z) * y) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y + z\right) \cdot y}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}
Initial program 58.9%
Taylor expanded in x around 0
Applied rewrites38.8%
Taylor expanded in x around inf
Applied rewrites32.1%
Taylor expanded in x around 0
Applied rewrites5.9%
(FPCore (x y z t a b c i) :precision binary64 (* (+ (* (+ y a) y) b) y))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((y + a) * y) + b) * y;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((y + a) * y) + b) * y
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((y + a) * y) + b) * y;
}
def code(x, y, z, t, a, b, c, i): return (((y + a) * y) + b) * y
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(y + a) * y) + b) * y) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((y + a) * y) + b) * y; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(y + a\right) \cdot y + b\right) \cdot y
\end{array}
Initial program 58.9%
Taylor expanded in x around 0
Applied rewrites38.8%
Taylor expanded in x around inf
Applied rewrites3.0%
Taylor expanded in x around -inf
Applied rewrites4.6%
(FPCore (x y z t a b c i) :precision binary64 (+ (* (+ y a) y) b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((y + a) * y) + b;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = ((y + a) * y) + b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((y + a) * y) + b;
}
def code(x, y, z, t, a, b, c, i): return ((y + a) * y) + b
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(y + a) * y) + b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((y + a) * y) + b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision]
\begin{array}{l}
\\
\left(y + a\right) \cdot y + b
\end{array}
Initial program 58.9%
Taylor expanded in x around 0
Applied rewrites38.8%
Taylor expanded in x around inf
Applied rewrites3.0%
Taylor expanded in x around -inf
Applied rewrites4.6%
Taylor expanded in x around inf
Applied rewrites3.0%
herbie shell --seed 2024321
(FPCore (x y z t a b c i)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2"
:precision binary64
:pre (TRUE)
(/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))