
(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 8 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 (- 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}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (- y x) 0.5)))
(if (<= x -4.4e-253)
(* 0.5 (+ x y))
(if (or (<= x 3.1e-158) (not (<= x 7.5e+144)))
(* (fabs (- y x)) 0.5)
(/ (- (* t_0 t_0) (* x x)) (+ (* y -0.5) (* x -0.5)))))))
double code(double x, double y) {
double t_0 = (y - x) * 0.5;
double tmp;
if (x <= -4.4e-253) {
tmp = 0.5 * (x + y);
} else if ((x <= 3.1e-158) || !(x <= 7.5e+144)) {
tmp = fabs((y - x)) * 0.5;
} else {
tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5));
}
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 - x) * 0.5d0
if (x <= (-4.4d-253)) then
tmp = 0.5d0 * (x + y)
else if ((x <= 3.1d-158) .or. (.not. (x <= 7.5d+144))) then
tmp = abs((y - x)) * 0.5d0
else
tmp = ((t_0 * t_0) - (x * x)) / ((y * (-0.5d0)) + (x * (-0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y - x) * 0.5;
double tmp;
if (x <= -4.4e-253) {
tmp = 0.5 * (x + y);
} else if ((x <= 3.1e-158) || !(x <= 7.5e+144)) {
tmp = Math.abs((y - x)) * 0.5;
} else {
tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5));
}
return tmp;
}
def code(x, y): t_0 = (y - x) * 0.5 tmp = 0 if x <= -4.4e-253: tmp = 0.5 * (x + y) elif (x <= 3.1e-158) or not (x <= 7.5e+144): tmp = math.fabs((y - x)) * 0.5 else: tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5)) return tmp
function code(x, y) t_0 = Float64(Float64(y - x) * 0.5) tmp = 0.0 if (x <= -4.4e-253) tmp = Float64(0.5 * Float64(x + y)); elseif ((x <= 3.1e-158) || !(x <= 7.5e+144)) tmp = Float64(abs(Float64(y - x)) * 0.5); else tmp = Float64(Float64(Float64(t_0 * t_0) - Float64(x * x)) / Float64(Float64(y * -0.5) + Float64(x * -0.5))); end return tmp end
function tmp_2 = code(x, y) t_0 = (y - x) * 0.5; tmp = 0.0; if (x <= -4.4e-253) tmp = 0.5 * (x + y); elseif ((x <= 3.1e-158) || ~((x <= 7.5e+144))) tmp = abs((y - x)) * 0.5; else tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[x, -4.4e-253], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 3.1e-158], N[Not[LessEqual[x, 7.5e+144]], $MachinePrecision]], N[(N[Abs[N[(y - x), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(N[(y * -0.5), $MachinePrecision] + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot 0.5\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{-253}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-158} \lor \neg \left(x \leq 7.5 \cdot 10^{+144}\right):\\
\;\;\;\;\left|y - x\right| \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 \cdot t_0 - x \cdot x}{y \cdot -0.5 + x \cdot -0.5}\\
\end{array}
\end{array}
if x < -4.39999999999999992e-253Initial program 100.0%
+-commutative100.0%
div-inv100.0%
fma-def100.0%
add-sqr-sqrt80.4%
fabs-sqr80.4%
add-sqr-sqrt81.2%
metadata-eval81.2%
Applied egg-rr81.2%
Taylor expanded in y around 0 81.2%
+-commutative81.2%
associate-+r+81.2%
distribute-lft1-in81.2%
metadata-eval81.2%
distribute-lft-out81.2%
Simplified81.2%
if -4.39999999999999992e-253 < x < 3.10000000000000018e-158 or 7.5000000000000006e144 < x Initial program 99.9%
Taylor expanded in x around 0 67.3%
if 3.10000000000000018e-158 < x < 7.5000000000000006e144Initial program 99.8%
+-commutative99.8%
div-inv99.8%
fma-def99.8%
add-sqr-sqrt12.6%
fabs-sqr12.6%
add-sqr-sqrt24.0%
metadata-eval24.0%
Applied egg-rr24.0%
fma-udef24.0%
flip-+16.6%
Applied egg-rr16.6%
add-sqr-sqrt5.3%
sqrt-prod84.6%
associate-*r*84.5%
sqrt-prod84.4%
fma-neg84.4%
*-commutative84.4%
associate-*l*84.4%
pow284.4%
Applied egg-rr84.4%
Taylor expanded in y around -inf 79.4%
sub-neg79.4%
+-commutative79.4%
associate-+l+79.4%
*-commutative79.4%
*-commutative79.4%
unpow279.4%
rem-square-sqrt79.7%
associate-*l*79.7%
metadata-eval79.7%
unpow279.7%
rem-square-sqrt80.3%
neg-mul-180.3%
distribute-rgt-out80.3%
metadata-eval80.3%
Simplified80.3%
Final simplification77.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (- y x) 0.5)))
(if (<= y -1e+42)
(/ (* y -0.25) 0.5)
(if (<= y -1.6e-239)
(/ (- (* t_0 t_0) (* x x)) (+ (* y -0.5) (* x -0.5)))
(* 0.5 (+ x y))))))
double code(double x, double y) {
double t_0 = (y - x) * 0.5;
double tmp;
if (y <= -1e+42) {
tmp = (y * -0.25) / 0.5;
} else if (y <= -1.6e-239) {
tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5));
} 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) :: t_0
real(8) :: tmp
t_0 = (y - x) * 0.5d0
if (y <= (-1d+42)) then
tmp = (y * (-0.25d0)) / 0.5d0
else if (y <= (-1.6d-239)) then
tmp = ((t_0 * t_0) - (x * x)) / ((y * (-0.5d0)) + (x * (-0.5d0)))
else
tmp = 0.5d0 * (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y - x) * 0.5;
double tmp;
if (y <= -1e+42) {
tmp = (y * -0.25) / 0.5;
} else if (y <= -1.6e-239) {
tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5));
} else {
tmp = 0.5 * (x + y);
}
return tmp;
}
def code(x, y): t_0 = (y - x) * 0.5 tmp = 0 if y <= -1e+42: tmp = (y * -0.25) / 0.5 elif y <= -1.6e-239: tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5)) else: tmp = 0.5 * (x + y) return tmp
function code(x, y) t_0 = Float64(Float64(y - x) * 0.5) tmp = 0.0 if (y <= -1e+42) tmp = Float64(Float64(y * -0.25) / 0.5); elseif (y <= -1.6e-239) tmp = Float64(Float64(Float64(t_0 * t_0) - Float64(x * x)) / Float64(Float64(y * -0.5) + Float64(x * -0.5))); else tmp = Float64(0.5 * Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) t_0 = (y - x) * 0.5; tmp = 0.0; if (y <= -1e+42) tmp = (y * -0.25) / 0.5; elseif (y <= -1.6e-239) tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5)); else tmp = 0.5 * (x + y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[y, -1e+42], N[(N[(y * -0.25), $MachinePrecision] / 0.5), $MachinePrecision], If[LessEqual[y, -1.6e-239], N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(N[(y * -0.5), $MachinePrecision] + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot 0.5\\
\mathbf{if}\;y \leq -1 \cdot 10^{+42}:\\
\;\;\;\;\frac{y \cdot -0.25}{0.5}\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{-239}:\\
\;\;\;\;\frac{t_0 \cdot t_0 - x \cdot x}{y \cdot -0.5 + x \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\end{array}
\end{array}
if y < -1.00000000000000004e42Initial program 100.0%
+-commutative100.0%
div-inv100.0%
fma-def100.0%
add-sqr-sqrt15.8%
fabs-sqr15.8%
add-sqr-sqrt17.1%
metadata-eval17.1%
Applied egg-rr17.1%
fma-udef17.1%
flip-+0.3%
Applied egg-rr0.3%
add-sqr-sqrt0.0%
sqrt-prod32.0%
associate-*r*32.0%
sqrt-prod31.7%
fma-neg31.7%
*-commutative31.7%
associate-*l*31.7%
pow231.7%
Applied egg-rr31.7%
Taylor expanded in y around -inf 78.7%
associate-*r/78.7%
unpow278.7%
rem-square-sqrt80.4%
Simplified80.4%
if -1.00000000000000004e42 < y < -1.6e-239Initial program 99.8%
+-commutative99.8%
div-inv99.8%
fma-def99.8%
add-sqr-sqrt22.6%
fabs-sqr22.6%
add-sqr-sqrt30.9%
metadata-eval30.9%
Applied egg-rr30.9%
fma-udef30.9%
flip-+16.6%
Applied egg-rr16.6%
add-sqr-sqrt10.4%
sqrt-prod66.3%
associate-*r*66.2%
sqrt-prod66.1%
fma-neg66.1%
*-commutative66.1%
associate-*l*66.1%
pow266.1%
Applied egg-rr66.1%
Taylor expanded in y around -inf 56.8%
sub-neg56.8%
+-commutative56.8%
associate-+l+56.8%
*-commutative56.8%
*-commutative56.8%
unpow256.8%
rem-square-sqrt57.4%
associate-*l*57.4%
metadata-eval57.4%
unpow257.4%
rem-square-sqrt57.7%
neg-mul-157.7%
distribute-rgt-out57.7%
metadata-eval57.7%
Simplified57.7%
if -1.6e-239 < y Initial program 100.0%
+-commutative100.0%
div-inv100.0%
fma-def100.0%
add-sqr-sqrt71.9%
fabs-sqr71.9%
add-sqr-sqrt77.2%
metadata-eval77.2%
Applied egg-rr77.2%
Taylor expanded in y around 0 77.2%
+-commutative77.2%
associate-+r+77.2%
distribute-lft1-in77.2%
metadata-eval77.2%
distribute-lft-out77.2%
Simplified77.2%
Final simplification73.5%
(FPCore (x y) :precision binary64 (if (<= y -1.02e-122) (/ (* y -0.25) 0.5) (* 0.5 (+ x y))))
double code(double x, double y) {
double tmp;
if (y <= -1.02e-122) {
tmp = (y * -0.25) / 0.5;
} 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 <= (-1.02d-122)) then
tmp = (y * (-0.25d0)) / 0.5d0
else
tmp = 0.5d0 * (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.02e-122) {
tmp = (y * -0.25) / 0.5;
} else {
tmp = 0.5 * (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.02e-122: tmp = (y * -0.25) / 0.5 else: tmp = 0.5 * (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.02e-122) tmp = Float64(Float64(y * -0.25) / 0.5); else tmp = Float64(0.5 * Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.02e-122) tmp = (y * -0.25) / 0.5; else tmp = 0.5 * (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.02e-122], N[(N[(y * -0.25), $MachinePrecision] / 0.5), $MachinePrecision], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-122}:\\
\;\;\;\;\frac{y \cdot -0.25}{0.5}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\end{array}
\end{array}
if y < -1.02000000000000002e-122Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt18.9%
fabs-sqr18.9%
add-sqr-sqrt22.4%
metadata-eval22.4%
Applied egg-rr22.4%
fma-udef22.4%
flip-+6.5%
Applied egg-rr6.5%
add-sqr-sqrt4.7%
sqrt-prod48.6%
associate-*r*48.6%
sqrt-prod48.4%
fma-neg48.4%
*-commutative48.4%
associate-*l*48.4%
pow248.4%
Applied egg-rr48.4%
Taylor expanded in y around -inf 65.0%
associate-*r/65.0%
unpow265.0%
rem-square-sqrt66.3%
Simplified66.3%
if -1.02000000000000002e-122 < y Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt65.2%
fabs-sqr65.2%
add-sqr-sqrt71.1%
metadata-eval71.1%
Applied egg-rr71.1%
Taylor expanded in y around 0 71.1%
+-commutative71.1%
associate-+r+71.1%
distribute-lft1-in71.1%
metadata-eval71.1%
distribute-lft-out71.1%
Simplified71.1%
Final simplification69.6%
(FPCore (x y) :precision binary64 (if (<= y 3.4e-185) x (* y 0.5)))
double code(double x, double y) {
double tmp;
if (y <= 3.4e-185) {
tmp = x;
} else {
tmp = y * 0.5;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.4d-185) then
tmp = x
else
tmp = y * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.4e-185) {
tmp = x;
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.4e-185: tmp = x else: tmp = y * 0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= 3.4e-185) tmp = x; else tmp = Float64(y * 0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.4e-185) tmp = x; else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.4e-185], x, N[(y * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{-185}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < 3.3999999999999998e-185Initial program 99.9%
Taylor expanded in x around inf 13.3%
if 3.3999999999999998e-185 < y Initial program 100.0%
+-commutative100.0%
div-inv100.0%
fma-def100.0%
add-sqr-sqrt83.9%
fabs-sqr83.9%
add-sqr-sqrt87.3%
metadata-eval87.3%
Applied egg-rr87.3%
Taylor expanded in y around inf 62.7%
Final simplification30.8%
(FPCore (x y) :precision binary64 (if (<= y 2.6e-101) (* x 0.5) (* y 0.5)))
double code(double x, double y) {
double tmp;
if (y <= 2.6e-101) {
tmp = x * 0.5;
} else {
tmp = y * 0.5;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.6d-101) then
tmp = x * 0.5d0
else
tmp = y * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.6e-101) {
tmp = x * 0.5;
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.6e-101: tmp = x * 0.5 else: tmp = y * 0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= 2.6e-101) tmp = Float64(x * 0.5); else tmp = Float64(y * 0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.6e-101) tmp = x * 0.5; else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.6e-101], N[(x * 0.5), $MachinePrecision], N[(y * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.6 \cdot 10^{-101}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < 2.6000000000000001e-101Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt35.0%
fabs-sqr35.0%
add-sqr-sqrt41.2%
metadata-eval41.2%
Applied egg-rr41.2%
Taylor expanded in y around 0 38.1%
distribute-lft1-in38.1%
metadata-eval38.1%
*-commutative38.1%
Simplified38.1%
if 2.6000000000000001e-101 < y Initial program 100.0%
+-commutative100.0%
div-inv100.0%
fma-def100.0%
add-sqr-sqrt88.2%
fabs-sqr88.2%
add-sqr-sqrt90.9%
metadata-eval90.9%
Applied egg-rr90.9%
Taylor expanded in y around inf 72.0%
Final simplification47.7%
(FPCore (x y) :precision binary64 (* 0.5 (+ x y)))
double code(double x, double y) {
return 0.5 * (x + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.5d0 * (x + y)
end function
public static double code(double x, double y) {
return 0.5 * (x + y);
}
def code(x, y): return 0.5 * (x + y)
function code(x, y) return Float64(0.5 * Float64(x + y)) end
function tmp = code(x, y) tmp = 0.5 * (x + y); end
code[x_, y_] := N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \left(x + y\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt55.1%
metadata-eval55.1%
Applied egg-rr55.1%
Taylor expanded in y around 0 55.1%
+-commutative55.1%
associate-+r+55.1%
distribute-lft1-in55.1%
metadata-eval55.1%
distribute-lft-out55.1%
Simplified55.1%
Final simplification55.1%
(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 11.7%
Final simplification11.7%
herbie shell --seed 2023238
(FPCore (x y)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
:precision binary64
(+ x (/ (fabs (- y x)) 2.0)))