
(FPCore (x y) :precision binary64 (+ x (/ (fabs (- y x)) 2.0)))
double code(double x, double y) {
return x + (fabs((y - x)) / 2.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (abs((y - x)) / 2.0d0)
end function
public static double code(double x, double y) {
return x + (Math.abs((y - x)) / 2.0);
}
def code(x, y): return x + (math.fabs((y - x)) / 2.0)
function code(x, y) return Float64(x + Float64(abs(Float64(y - x)) / 2.0)) end
function tmp = code(x, y) tmp = x + (abs((y - x)) / 2.0); end
code[x_, y_] := N[(x + N[(N[Abs[N[(y - x), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left|y - x\right|}{2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ x (/ (fabs (- y x)) 2.0)))
double code(double x, double y) {
return x + (fabs((y - x)) / 2.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (abs((y - x)) / 2.0d0)
end function
public static double code(double x, double y) {
return x + (Math.abs((y - x)) / 2.0);
}
def code(x, y): return x + (math.fabs((y - x)) / 2.0)
function code(x, y) return Float64(x + Float64(abs(Float64(y - x)) / 2.0)) end
function tmp = code(x, y) tmp = x + (abs((y - x)) / 2.0); end
code[x_, y_] := N[(x + N[(N[Abs[N[(y - x), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left|y - x\right|}{2}
\end{array}
(FPCore (x y) :precision binary64 (+ x (/ (fabs (- x y)) 2.0)))
double code(double x, double y) {
return x + (fabs((x - y)) / 2.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (abs((x - y)) / 2.0d0)
end function
public static double code(double x, double y) {
return x + (Math.abs((x - y)) / 2.0);
}
def code(x, y): return x + (math.fabs((x - y)) / 2.0)
function code(x, y) return Float64(x + Float64(abs(Float64(x - y)) / 2.0)) end
function tmp = code(x, y) tmp = x + (abs((x - y)) / 2.0); end
code[x_, y_] := N[(x + N[(N[Abs[N[(x - y), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left|x - y\right|}{2}
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= y -5.1e-61) (+ x (* -0.5 (- y x))) (if (<= y 5.1e-231) (+ x (/ (fabs x) 2.0)) (* 0.5 (+ x y)))))
double code(double x, double y) {
double tmp;
if (y <= -5.1e-61) {
tmp = x + (-0.5 * (y - x));
} else if (y <= 5.1e-231) {
tmp = x + (fabs(x) / 2.0);
} else {
tmp = 0.5 * (x + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-5.1d-61)) then
tmp = x + ((-0.5d0) * (y - x))
else if (y <= 5.1d-231) then
tmp = x + (abs(x) / 2.0d0)
else
tmp = 0.5d0 * (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -5.1e-61) {
tmp = x + (-0.5 * (y - x));
} else if (y <= 5.1e-231) {
tmp = x + (Math.abs(x) / 2.0);
} else {
tmp = 0.5 * (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -5.1e-61: tmp = x + (-0.5 * (y - x)) elif y <= 5.1e-231: tmp = x + (math.fabs(x) / 2.0) else: tmp = 0.5 * (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= -5.1e-61) tmp = Float64(x + Float64(-0.5 * Float64(y - x))); elseif (y <= 5.1e-231) tmp = Float64(x + Float64(abs(x) / 2.0)); else tmp = Float64(0.5 * Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -5.1e-61) tmp = x + (-0.5 * (y - x)); elseif (y <= 5.1e-231) tmp = x + (abs(x) / 2.0); else tmp = 0.5 * (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -5.1e-61], N[(x + N[(-0.5 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.1e-231], N[(x + N[(N[Abs[x], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{-61}:\\
\;\;\;\;x + -0.5 \cdot \left(y - x\right)\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{-231}:\\
\;\;\;\;x + \frac{\left|x\right|}{2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\end{array}
\end{array}
if y < -5.09999999999999968e-61Initial program 99.9%
*-un-lft-identity99.9%
fma-define99.9%
add-sqr-sqrt10.6%
fabs-sqr10.6%
add-sqr-sqrt13.8%
frac-2neg13.8%
distribute-frac-neg13.8%
fmm-undef13.8%
*-un-lft-identity13.8%
metadata-eval13.8%
Applied egg-rr13.8%
Applied egg-rr91.2%
*-commutative91.2%
+-commutative91.2%
sub-neg91.2%
Simplified91.2%
if -5.09999999999999968e-61 < y < 5.1e-231Initial program 99.9%
Taylor expanded in y around 0 87.6%
neg-mul-187.6%
Simplified87.6%
if 5.1e-231 < y Initial program 99.9%
*-un-lft-identity99.9%
fma-define99.9%
add-sqr-sqrt82.3%
fabs-sqr82.3%
add-sqr-sqrt85.9%
frac-2neg85.9%
distribute-frac-neg85.9%
fmm-undef85.9%
*-un-lft-identity85.9%
metadata-eval85.9%
Applied egg-rr85.9%
Taylor expanded in x around 0 85.9%
cancel-sign-sub-inv85.9%
metadata-eval85.9%
distribute-lft-in85.9%
Simplified85.9%
Final simplification88.0%
(FPCore (x y) :precision binary64 (if (<= x -1.06e-96) (* x 0.5) (if (<= x 2.4e-91) (* y 0.5) (* x 1.5))))
double code(double x, double y) {
double tmp;
if (x <= -1.06e-96) {
tmp = x * 0.5;
} else if (x <= 2.4e-91) {
tmp = y * 0.5;
} else {
tmp = x * 1.5;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.06d-96)) then
tmp = x * 0.5d0
else if (x <= 2.4d-91) then
tmp = y * 0.5d0
else
tmp = x * 1.5d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.06e-96) {
tmp = x * 0.5;
} else if (x <= 2.4e-91) {
tmp = y * 0.5;
} else {
tmp = x * 1.5;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.06e-96: tmp = x * 0.5 elif x <= 2.4e-91: tmp = y * 0.5 else: tmp = x * 1.5 return tmp
function code(x, y) tmp = 0.0 if (x <= -1.06e-96) tmp = Float64(x * 0.5); elseif (x <= 2.4e-91) tmp = Float64(y * 0.5); else tmp = Float64(x * 1.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.06e-96) tmp = x * 0.5; elseif (x <= 2.4e-91) tmp = y * 0.5; else tmp = x * 1.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.06e-96], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 2.4e-91], N[(y * 0.5), $MachinePrecision], N[(x * 1.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{-96}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-91}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot 1.5\\
\end{array}
\end{array}
if x < -1.05999999999999998e-96Initial program 100.0%
*-un-lft-identity100.0%
fma-define100.0%
add-sqr-sqrt77.3%
fabs-sqr77.3%
add-sqr-sqrt78.0%
frac-2neg78.0%
distribute-frac-neg78.0%
fmm-undef78.0%
*-un-lft-identity78.0%
metadata-eval78.0%
Applied egg-rr78.0%
Taylor expanded in x around inf 58.9%
*-commutative58.9%
Simplified58.9%
if -1.05999999999999998e-96 < x < 2.40000000000000011e-91Initial program 100.0%
*-un-lft-identity100.0%
fma-define100.0%
add-sqr-sqrt51.5%
fabs-sqr51.5%
add-sqr-sqrt53.7%
frac-2neg53.7%
distribute-frac-neg53.7%
fmm-undef53.7%
*-un-lft-identity53.7%
metadata-eval53.7%
Applied egg-rr53.7%
Taylor expanded in x around 0 47.3%
*-commutative47.3%
Simplified47.3%
if 2.40000000000000011e-91 < x Initial program 99.7%
Taylor expanded in y around 0 64.7%
neg-mul-164.7%
Simplified64.7%
add-sqr-sqrt64.7%
associate-/l*64.7%
fabs-neg64.7%
add-sqr-sqrt64.7%
fabs-sqr64.7%
add-sqr-sqrt64.7%
fabs-neg64.7%
add-sqr-sqrt64.7%
fabs-sqr64.7%
add-sqr-sqrt64.7%
Applied egg-rr64.7%
associate-*r/64.7%
rem-square-sqrt64.7%
Simplified64.7%
Taylor expanded in x around 0 64.7%
*-commutative64.7%
Simplified64.7%
(FPCore (x y) :precision binary64 (if (<= y 7.8e-233) (+ x (* -0.5 (- y x))) (* 0.5 (+ x y))))
double code(double x, double y) {
double tmp;
if (y <= 7.8e-233) {
tmp = x + (-0.5 * (y - x));
} else {
tmp = 0.5 * (x + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 7.8d-233) then
tmp = x + ((-0.5d0) * (y - x))
else
tmp = 0.5d0 * (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 7.8e-233) {
tmp = x + (-0.5 * (y - x));
} else {
tmp = 0.5 * (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7.8e-233: tmp = x + (-0.5 * (y - x)) else: tmp = 0.5 * (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= 7.8e-233) tmp = Float64(x + Float64(-0.5 * Float64(y - x))); else tmp = Float64(0.5 * Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 7.8e-233) tmp = x + (-0.5 * (y - x)); else tmp = 0.5 * (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7.8e-233], N[(x + N[(-0.5 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.8 \cdot 10^{-233}:\\
\;\;\;\;x + -0.5 \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\end{array}
\end{array}
if y < 7.8000000000000002e-233Initial program 99.9%
*-un-lft-identity99.9%
fma-define99.9%
add-sqr-sqrt19.3%
fabs-sqr19.3%
add-sqr-sqrt25.2%
frac-2neg25.2%
distribute-frac-neg25.2%
fmm-undef25.2%
*-un-lft-identity25.2%
metadata-eval25.2%
Applied egg-rr25.2%
Applied egg-rr83.9%
*-commutative83.9%
+-commutative83.9%
sub-neg83.9%
Simplified83.9%
if 7.8000000000000002e-233 < y Initial program 99.9%
*-un-lft-identity99.9%
fma-define99.9%
add-sqr-sqrt82.3%
fabs-sqr82.3%
add-sqr-sqrt85.9%
frac-2neg85.9%
distribute-frac-neg85.9%
fmm-undef85.9%
*-un-lft-identity85.9%
metadata-eval85.9%
Applied egg-rr85.9%
Taylor expanded in x around 0 85.9%
cancel-sign-sub-inv85.9%
metadata-eval85.9%
distribute-lft-in85.9%
Simplified85.9%
Final simplification84.8%
(FPCore (x y) :precision binary64 (if (<= x 2.4e-74) (* 0.5 (+ x y)) (+ x (/ 1.0 (/ 2.0 x)))))
double code(double x, double y) {
double tmp;
if (x <= 2.4e-74) {
tmp = 0.5 * (x + y);
} else {
tmp = x + (1.0 / (2.0 / x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 2.4d-74) then
tmp = 0.5d0 * (x + y)
else
tmp = x + (1.0d0 / (2.0d0 / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 2.4e-74) {
tmp = 0.5 * (x + y);
} else {
tmp = x + (1.0 / (2.0 / x));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2.4e-74: tmp = 0.5 * (x + y) else: tmp = x + (1.0 / (2.0 / x)) return tmp
function code(x, y) tmp = 0.0 if (x <= 2.4e-74) tmp = Float64(0.5 * Float64(x + y)); else tmp = Float64(x + Float64(1.0 / Float64(2.0 / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 2.4e-74) tmp = 0.5 * (x + y); else tmp = x + (1.0 / (2.0 / x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2.4e-74], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{-74}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{2}{x}}\\
\end{array}
\end{array}
if x < 2.3999999999999999e-74Initial program 100.0%
*-un-lft-identity100.0%
fma-define100.0%
add-sqr-sqrt63.2%
fabs-sqr63.2%
add-sqr-sqrt64.8%
frac-2neg64.8%
distribute-frac-neg64.8%
fmm-undef64.8%
*-un-lft-identity64.8%
metadata-eval64.8%
Applied egg-rr64.8%
Taylor expanded in x around 0 64.9%
cancel-sign-sub-inv64.9%
metadata-eval64.9%
distribute-lft-in64.9%
Simplified64.9%
if 2.3999999999999999e-74 < x Initial program 99.7%
Taylor expanded in y around 0 68.0%
neg-mul-168.0%
Simplified68.0%
clear-num68.0%
inv-pow68.0%
fabs-neg68.0%
add-sqr-sqrt67.9%
fabs-sqr67.9%
add-sqr-sqrt68.0%
Applied egg-rr68.0%
unpow-168.0%
Simplified68.0%
(FPCore (x y) :precision binary64 (if (<= x 2.8e-75) (* 0.5 (+ x y)) (* x 1.5)))
double code(double x, double y) {
double tmp;
if (x <= 2.8e-75) {
tmp = 0.5 * (x + y);
} else {
tmp = x * 1.5;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 2.8d-75) then
tmp = 0.5d0 * (x + y)
else
tmp = x * 1.5d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 2.8e-75) {
tmp = 0.5 * (x + y);
} else {
tmp = x * 1.5;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2.8e-75: tmp = 0.5 * (x + y) else: tmp = x * 1.5 return tmp
function code(x, y) tmp = 0.0 if (x <= 2.8e-75) tmp = Float64(0.5 * Float64(x + y)); else tmp = Float64(x * 1.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 2.8e-75) tmp = 0.5 * (x + y); else tmp = x * 1.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2.8e-75], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x * 1.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8 \cdot 10^{-75}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 1.5\\
\end{array}
\end{array}
if x < 2.79999999999999998e-75Initial program 100.0%
*-un-lft-identity100.0%
fma-define100.0%
add-sqr-sqrt63.2%
fabs-sqr63.2%
add-sqr-sqrt64.8%
frac-2neg64.8%
distribute-frac-neg64.8%
fmm-undef64.8%
*-un-lft-identity64.8%
metadata-eval64.8%
Applied egg-rr64.8%
Taylor expanded in x around 0 64.9%
cancel-sign-sub-inv64.9%
metadata-eval64.9%
distribute-lft-in64.9%
Simplified64.9%
if 2.79999999999999998e-75 < x Initial program 99.7%
Taylor expanded in y around 0 68.0%
neg-mul-168.0%
Simplified68.0%
add-sqr-sqrt67.9%
associate-/l*67.9%
fabs-neg67.9%
add-sqr-sqrt67.9%
fabs-sqr67.9%
add-sqr-sqrt67.9%
fabs-neg67.9%
add-sqr-sqrt67.9%
fabs-sqr67.9%
add-sqr-sqrt67.9%
Applied egg-rr67.9%
associate-*r/67.9%
rem-square-sqrt68.0%
Simplified68.0%
Taylor expanded in x around 0 68.0%
*-commutative68.0%
Simplified68.0%
(FPCore (x y) :precision binary64 (if (<= x -1e-309) (* x 0.5) (* x 1.5)))
double code(double x, double y) {
double tmp;
if (x <= -1e-309) {
tmp = x * 0.5;
} else {
tmp = x * 1.5;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1d-309)) then
tmp = x * 0.5d0
else
tmp = x * 1.5d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1e-309) {
tmp = x * 0.5;
} else {
tmp = x * 1.5;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1e-309: tmp = x * 0.5 else: tmp = x * 1.5 return tmp
function code(x, y) tmp = 0.0 if (x <= -1e-309) tmp = Float64(x * 0.5); else tmp = Float64(x * 1.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1e-309) tmp = x * 0.5; else tmp = x * 1.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1e-309], N[(x * 0.5), $MachinePrecision], N[(x * 1.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-309}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot 1.5\\
\end{array}
\end{array}
if x < -1.000000000000002e-309Initial program 100.0%
*-un-lft-identity100.0%
fma-define100.0%
add-sqr-sqrt71.5%
fabs-sqr71.5%
add-sqr-sqrt72.3%
frac-2neg72.3%
distribute-frac-neg72.3%
fmm-undef72.3%
*-un-lft-identity72.3%
metadata-eval72.3%
Applied egg-rr72.3%
Taylor expanded in x around inf 44.3%
*-commutative44.3%
Simplified44.3%
if -1.000000000000002e-309 < x Initial program 99.8%
Taylor expanded in y around 0 49.8%
neg-mul-149.8%
Simplified49.8%
add-sqr-sqrt49.7%
associate-/l*49.7%
fabs-neg49.7%
add-sqr-sqrt49.7%
fabs-sqr49.7%
add-sqr-sqrt49.7%
fabs-neg49.7%
add-sqr-sqrt49.7%
fabs-sqr49.7%
add-sqr-sqrt49.7%
Applied egg-rr49.7%
associate-*r/49.7%
rem-square-sqrt49.8%
Simplified49.8%
Taylor expanded in x around 0 49.8%
*-commutative49.8%
Simplified49.8%
(FPCore (x y) :precision binary64 (* x 0.5))
double code(double x, double y) {
return x * 0.5;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * 0.5d0
end function
public static double code(double x, double y) {
return x * 0.5;
}
def code(x, y): return x * 0.5
function code(x, y) return Float64(x * 0.5) end
function tmp = code(x, y) tmp = x * 0.5; end
code[x_, y_] := N[(x * 0.5), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 0.5
\end{array}
Initial program 99.9%
*-un-lft-identity99.9%
fma-define99.9%
add-sqr-sqrt48.1%
fabs-sqr48.1%
add-sqr-sqrt53.0%
frac-2neg53.0%
distribute-frac-neg53.0%
fmm-undef53.0%
*-un-lft-identity53.0%
metadata-eval53.0%
Applied egg-rr53.0%
Taylor expanded in x around inf 27.3%
*-commutative27.3%
Simplified27.3%
(FPCore (x y) :precision binary64 x)
double code(double x, double y) {
return x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x
end function
public static double code(double x, double y) {
return x;
}
def code(x, y): return x
function code(x, y) return x end
function tmp = code(x, y) tmp = x; end
code[x_, y_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
Taylor expanded in x around inf 10.7%
herbie shell --seed 2024131
(FPCore (x y)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
:precision binary64
(+ x (/ (fabs (- y x)) 2.0)))