
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
Initial program 99.9%
(FPCore (x y) :precision binary64 (if (or (<= y -5.5e+82) (not (<= y 8200.0))) (+ 1.0 (* y (sqrt x))) (- 1.0 x)))
double code(double x, double y) {
double tmp;
if ((y <= -5.5e+82) || !(y <= 8200.0)) {
tmp = 1.0 + (y * sqrt(x));
} else {
tmp = 1.0 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-5.5d+82)) .or. (.not. (y <= 8200.0d0))) then
tmp = 1.0d0 + (y * sqrt(x))
else
tmp = 1.0d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -5.5e+82) || !(y <= 8200.0)) {
tmp = 1.0 + (y * Math.sqrt(x));
} else {
tmp = 1.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -5.5e+82) or not (y <= 8200.0): tmp = 1.0 + (y * math.sqrt(x)) else: tmp = 1.0 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -5.5e+82) || !(y <= 8200.0)) tmp = Float64(1.0 + Float64(y * sqrt(x))); else tmp = Float64(1.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -5.5e+82) || ~((y <= 8200.0))) tmp = 1.0 + (y * sqrt(x)); else tmp = 1.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -5.5e+82], N[Not[LessEqual[y, 8200.0]], $MachinePrecision]], N[(1.0 + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+82} \lor \neg \left(y \leq 8200\right):\\
\;\;\;\;1 + y \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;1 - x\\
\end{array}
\end{array}
if y < -5.49999999999999997e82 or 8200 < y Initial program 99.8%
Taylor expanded in x around 0 93.3%
if -5.49999999999999997e82 < y < 8200Initial program 100.0%
add-sqr-sqrt43.6%
pow243.6%
Applied egg-rr43.6%
Taylor expanded in y around 0 98.5%
Final simplification96.3%
(FPCore (x y) :precision binary64 (if (or (<= y -6.8e+83) (not (<= y 3.2e+88))) (* y (sqrt x)) (- 1.0 x)))
double code(double x, double y) {
double tmp;
if ((y <= -6.8e+83) || !(y <= 3.2e+88)) {
tmp = y * sqrt(x);
} else {
tmp = 1.0 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-6.8d+83)) .or. (.not. (y <= 3.2d+88))) then
tmp = y * sqrt(x)
else
tmp = 1.0d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -6.8e+83) || !(y <= 3.2e+88)) {
tmp = y * Math.sqrt(x);
} else {
tmp = 1.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -6.8e+83) or not (y <= 3.2e+88): tmp = y * math.sqrt(x) else: tmp = 1.0 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -6.8e+83) || !(y <= 3.2e+88)) tmp = Float64(y * sqrt(x)); else tmp = Float64(1.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -6.8e+83) || ~((y <= 3.2e+88))) tmp = y * sqrt(x); else tmp = 1.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -6.8e+83], N[Not[LessEqual[y, 3.2e+88]], $MachinePrecision]], N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+83} \lor \neg \left(y \leq 3.2 \cdot 10^{+88}\right):\\
\;\;\;\;y \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;1 - x\\
\end{array}
\end{array}
if y < -6.7999999999999996e83 or 3.1999999999999999e88 < y Initial program 99.7%
Taylor expanded in x around inf 80.3%
Taylor expanded in x around 0 97.3%
neg-mul-197.3%
+-commutative97.3%
fma-define97.3%
fmm-def97.3%
Simplified97.3%
Taylor expanded in x around 0 95.2%
if -6.7999999999999996e83 < y < 3.1999999999999999e88Initial program 100.0%
add-sqr-sqrt49.4%
pow249.4%
Applied egg-rr49.4%
Taylor expanded in y around 0 94.1%
Final simplification94.5%
(FPCore (x y) :precision binary64 (if (<= x 1.0) (+ 1.0 (* y (sqrt x))) (* x (+ (/ y (sqrt x)) -1.0))))
double code(double x, double y) {
double tmp;
if (x <= 1.0) {
tmp = 1.0 + (y * sqrt(x));
} else {
tmp = x * ((y / sqrt(x)) + -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.0d0) then
tmp = 1.0d0 + (y * sqrt(x))
else
tmp = x * ((y / sqrt(x)) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.0) {
tmp = 1.0 + (y * Math.sqrt(x));
} else {
tmp = x * ((y / Math.sqrt(x)) + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.0: tmp = 1.0 + (y * math.sqrt(x)) else: tmp = x * ((y / math.sqrt(x)) + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.0) tmp = Float64(1.0 + Float64(y * sqrt(x))); else tmp = Float64(x * Float64(Float64(y / sqrt(x)) + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.0) tmp = 1.0 + (y * sqrt(x)); else tmp = x * ((y / sqrt(x)) + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.0], N[(1.0 + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;1 + y \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{\sqrt{x}} + -1\right)\\
\end{array}
\end{array}
if x < 1Initial program 99.9%
Taylor expanded in x around 0 99.9%
if 1 < x Initial program 99.9%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
sqrt-div99.7%
metadata-eval99.7%
un-div-inv99.7%
Applied egg-rr99.7%
Final simplification99.8%
(FPCore (x y) :precision binary64 (let* ((t_0 (* y (sqrt x)))) (if (<= x 3.2e-16) (+ 1.0 t_0) (- t_0 x))))
double code(double x, double y) {
double t_0 = y * sqrt(x);
double tmp;
if (x <= 3.2e-16) {
tmp = 1.0 + t_0;
} else {
tmp = t_0 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y * sqrt(x)
if (x <= 3.2d-16) then
tmp = 1.0d0 + t_0
else
tmp = t_0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * Math.sqrt(x);
double tmp;
if (x <= 3.2e-16) {
tmp = 1.0 + t_0;
} else {
tmp = t_0 - x;
}
return tmp;
}
def code(x, y): t_0 = y * math.sqrt(x) tmp = 0 if x <= 3.2e-16: tmp = 1.0 + t_0 else: tmp = t_0 - x return tmp
function code(x, y) t_0 = Float64(y * sqrt(x)) tmp = 0.0 if (x <= 3.2e-16) tmp = Float64(1.0 + t_0); else tmp = Float64(t_0 - x); end return tmp end
function tmp_2 = code(x, y) t_0 = y * sqrt(x); tmp = 0.0; if (x <= 3.2e-16) tmp = 1.0 + t_0; else tmp = t_0 - x; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 3.2e-16], N[(1.0 + t$95$0), $MachinePrecision], N[(t$95$0 - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x}\\
\mathbf{if}\;x \leq 3.2 \cdot 10^{-16}:\\
\;\;\;\;1 + t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 - x\\
\end{array}
\end{array}
if x < 3.20000000000000023e-16Initial program 99.9%
Taylor expanded in x around 0 99.9%
if 3.20000000000000023e-16 < x Initial program 99.9%
Taylor expanded in x around inf 99.6%
Taylor expanded in x around 0 99.6%
neg-mul-199.6%
+-commutative99.6%
fma-define99.6%
fmm-def99.6%
Simplified99.6%
Final simplification99.7%
(FPCore (x y) :precision binary64 (if (<= y -8.2e+193) (/ (- 1.0 (* x x)) (+ 1.0 x)) (if (<= y 3.2e+125) (- 1.0 x) (/ (+ 1.0 (* x x)) (+ 1.0 x)))))
double code(double x, double y) {
double tmp;
if (y <= -8.2e+193) {
tmp = (1.0 - (x * x)) / (1.0 + x);
} else if (y <= 3.2e+125) {
tmp = 1.0 - x;
} else {
tmp = (1.0 + (x * x)) / (1.0 + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-8.2d+193)) then
tmp = (1.0d0 - (x * x)) / (1.0d0 + x)
else if (y <= 3.2d+125) then
tmp = 1.0d0 - x
else
tmp = (1.0d0 + (x * x)) / (1.0d0 + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -8.2e+193) {
tmp = (1.0 - (x * x)) / (1.0 + x);
} else if (y <= 3.2e+125) {
tmp = 1.0 - x;
} else {
tmp = (1.0 + (x * x)) / (1.0 + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -8.2e+193: tmp = (1.0 - (x * x)) / (1.0 + x) elif y <= 3.2e+125: tmp = 1.0 - x else: tmp = (1.0 + (x * x)) / (1.0 + x) return tmp
function code(x, y) tmp = 0.0 if (y <= -8.2e+193) tmp = Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)); elseif (y <= 3.2e+125) tmp = Float64(1.0 - x); else tmp = Float64(Float64(1.0 + Float64(x * x)) / Float64(1.0 + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -8.2e+193) tmp = (1.0 - (x * x)) / (1.0 + x); elseif (y <= 3.2e+125) tmp = 1.0 - x; else tmp = (1.0 + (x * x)) / (1.0 + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -8.2e+193], N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+125], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 + N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+193}:\\
\;\;\;\;\frac{1 - x \cdot x}{1 + x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+125}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + x \cdot x}{1 + x}\\
\end{array}
\end{array}
if y < -8.1999999999999994e193Initial program 99.7%
add-sqr-sqrt0.0%
pow20.0%
Applied egg-rr0.0%
Taylor expanded in y around 0 4.0%
sub-neg4.0%
flip-+35.3%
metadata-eval35.3%
Applied egg-rr35.3%
if -8.1999999999999994e193 < y < 3.19999999999999983e125Initial program 100.0%
add-sqr-sqrt45.7%
pow245.7%
Applied egg-rr45.7%
Taylor expanded in y around 0 83.4%
if 3.19999999999999983e125 < y Initial program 99.7%
add-sqr-sqrt99.3%
pow299.3%
Applied egg-rr99.3%
Taylor expanded in y around 0 4.6%
sub-neg4.6%
flip-+4.6%
metadata-eval4.6%
Applied egg-rr4.6%
neg-sub04.6%
sub-neg4.6%
pow14.6%
metadata-eval4.6%
sqrt-pow125.0%
pow225.0%
sqr-neg25.0%
sqrt-prod25.0%
add-sqr-sqrt25.0%
Applied egg-rr25.0%
Final simplification69.3%
(FPCore (x y) :precision binary64 (if (<= y -8.2e+193) (/ (- 1.0 (* x x)) (+ 1.0 x)) (- 1.0 x)))
double code(double x, double y) {
double tmp;
if (y <= -8.2e+193) {
tmp = (1.0 - (x * x)) / (1.0 + x);
} else {
tmp = 1.0 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-8.2d+193)) then
tmp = (1.0d0 - (x * x)) / (1.0d0 + x)
else
tmp = 1.0d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -8.2e+193) {
tmp = (1.0 - (x * x)) / (1.0 + x);
} else {
tmp = 1.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -8.2e+193: tmp = (1.0 - (x * x)) / (1.0 + x) else: tmp = 1.0 - x return tmp
function code(x, y) tmp = 0.0 if (y <= -8.2e+193) tmp = Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)); else tmp = Float64(1.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -8.2e+193) tmp = (1.0 - (x * x)) / (1.0 + x); else tmp = 1.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -8.2e+193], N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(1.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+193}:\\
\;\;\;\;\frac{1 - x \cdot x}{1 + x}\\
\mathbf{else}:\\
\;\;\;\;1 - x\\
\end{array}
\end{array}
if y < -8.1999999999999994e193Initial program 99.7%
add-sqr-sqrt0.0%
pow20.0%
Applied egg-rr0.0%
Taylor expanded in y around 0 4.0%
sub-neg4.0%
flip-+35.3%
metadata-eval35.3%
Applied egg-rr35.3%
if -8.1999999999999994e193 < y Initial program 99.9%
add-sqr-sqrt55.4%
pow255.4%
Applied egg-rr55.4%
Taylor expanded in y around 0 69.2%
Final simplification66.0%
(FPCore (x y) :precision binary64 (if (<= y -8.2e+193) (/ (- 1.0 (* x x)) x) (- 1.0 x)))
double code(double x, double y) {
double tmp;
if (y <= -8.2e+193) {
tmp = (1.0 - (x * x)) / x;
} else {
tmp = 1.0 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-8.2d+193)) then
tmp = (1.0d0 - (x * x)) / x
else
tmp = 1.0d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -8.2e+193) {
tmp = (1.0 - (x * x)) / x;
} else {
tmp = 1.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -8.2e+193: tmp = (1.0 - (x * x)) / x else: tmp = 1.0 - x return tmp
function code(x, y) tmp = 0.0 if (y <= -8.2e+193) tmp = Float64(Float64(1.0 - Float64(x * x)) / x); else tmp = Float64(1.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -8.2e+193) tmp = (1.0 - (x * x)) / x; else tmp = 1.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -8.2e+193], N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(1.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+193}:\\
\;\;\;\;\frac{1 - x \cdot x}{x}\\
\mathbf{else}:\\
\;\;\;\;1 - x\\
\end{array}
\end{array}
if y < -8.1999999999999994e193Initial program 99.7%
add-sqr-sqrt0.0%
pow20.0%
Applied egg-rr0.0%
Taylor expanded in y around 0 4.0%
sub-neg4.0%
flip-+35.3%
metadata-eval35.3%
Applied egg-rr35.3%
Taylor expanded in x around inf 35.1%
if -8.1999999999999994e193 < y Initial program 99.9%
add-sqr-sqrt55.4%
pow255.4%
Applied egg-rr55.4%
Taylor expanded in y around 0 69.2%
Final simplification66.0%
(FPCore (x y) :precision binary64 (if (<= x 1.0) 1.0 (- x)))
double code(double x, double y) {
double tmp;
if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = -x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.0d0) then
tmp = 1.0d0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.0: tmp = 1.0 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if (x <= 1.0) tmp = 1.0; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.0) tmp = 1.0; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.0], 1.0, (-x)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < 1Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in y around 0 62.5%
if 1 < x Initial program 99.9%
Taylor expanded in x around inf 99.6%
Taylor expanded in y around 0 63.3%
neg-mul-163.3%
Simplified63.3%
(FPCore (x y) :precision binary64 (- 1.0 x))
double code(double x, double y) {
return 1.0 - x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - x
end function
public static double code(double x, double y) {
return 1.0 - x;
}
def code(x, y): return 1.0 - x
function code(x, y) return Float64(1.0 - x) end
function tmp = code(x, y) tmp = 1.0 - x; end
code[x_, y_] := N[(1.0 - x), $MachinePrecision]
\begin{array}{l}
\\
1 - x
\end{array}
Initial program 99.9%
add-sqr-sqrt50.2%
pow250.2%
Applied egg-rr50.2%
Taylor expanded in y around 0 63.1%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 66.2%
Taylor expanded in y around 0 29.6%
herbie shell --seed 2024181
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E"
:precision binary64
(+ (- 1.0 x) (* y (sqrt x))))