
(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 13 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 -1.1e-195)
(- x (* 0.5 (+ x y)))
(if (<= y 1.6e-88)
(+ x (/ (fabs x) 2.0))
(+ x (* (+ x y) (* (+ x y) (/ 1.0 (* 2.0 (+ x y)))))))))
double code(double x, double y) {
double tmp;
if (y <= -1.1e-195) {
tmp = x - (0.5 * (x + y));
} else if (y <= 1.6e-88) {
tmp = x + (fabs(x) / 2.0);
} else {
tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (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.1d-195)) then
tmp = x - (0.5d0 * (x + y))
else if (y <= 1.6d-88) then
tmp = x + (abs(x) / 2.0d0)
else
tmp = x + ((x + y) * ((x + y) * (1.0d0 / (2.0d0 * (x + y)))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.1e-195) {
tmp = x - (0.5 * (x + y));
} else if (y <= 1.6e-88) {
tmp = x + (Math.abs(x) / 2.0);
} else {
tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y)))));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.1e-195: tmp = x - (0.5 * (x + y)) elif y <= 1.6e-88: tmp = x + (math.fabs(x) / 2.0) else: tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y))))) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.1e-195) tmp = Float64(x - Float64(0.5 * Float64(x + y))); elseif (y <= 1.6e-88) tmp = Float64(x + Float64(abs(x) / 2.0)); else tmp = Float64(x + Float64(Float64(x + y) * Float64(Float64(x + y) * Float64(1.0 / Float64(2.0 * Float64(x + y)))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.1e-195) tmp = x - (0.5 * (x + y)); elseif (y <= 1.6e-88) tmp = x + (abs(x) / 2.0); else tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y))))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.1e-195], N[(x - N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-88], N[(x + N[(N[Abs[x], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(x + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(1.0 / N[(2.0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-195}:\\
\;\;\;\;x - 0.5 \cdot \left(x + y\right)\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-88}:\\
\;\;\;\;x + \frac{\left|x\right|}{2}\\
\mathbf{else}:\\
\;\;\;\;x + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \frac{1}{2 \cdot \left(x + y\right)}\right)\\
\end{array}
\end{array}
if y < -1.10000000000000003e-195Initial program 99.9%
Taylor expanded in x around inf 85.2%
*-inverses85.2%
div-sub85.2%
add-sqr-sqrt42.3%
associate-/r*42.4%
Applied egg-rr42.4%
div-inv42.4%
metadata-eval42.4%
Applied egg-rr70.6%
associate-*r*70.6%
associate-*r/55.9%
*-commutative55.9%
associate-/l*85.3%
*-inverses85.3%
*-rgt-identity85.3%
*-commutative85.3%
+-commutative85.3%
Simplified85.3%
if -1.10000000000000003e-195 < y < 1.60000000000000006e-88Initial program 99.8%
Taylor expanded in y around 0 93.6%
neg-mul-193.6%
Simplified93.6%
if 1.60000000000000006e-88 < y Initial program 99.9%
add-cube-cbrt98.2%
fabs-mul98.2%
pow298.2%
Applied egg-rr98.2%
unpow298.2%
fabs-sqr98.2%
Applied egg-rr98.2%
unpow298.2%
Simplified98.2%
add-sqr-sqrt82.2%
fabs-sqr82.2%
unpow282.2%
add-sqr-sqrt85.1%
add-cube-cbrt86.7%
sub-neg86.7%
add-sqr-sqrt44.7%
sqrt-unprod79.0%
sqr-neg79.0%
sqrt-unprod53.8%
add-sqr-sqrt88.8%
flip-+52.6%
clear-num52.5%
sub-neg52.5%
add-sqr-sqrt22.5%
sqrt-unprod50.8%
sqr-neg50.8%
sqrt-unprod28.7%
add-sqr-sqrt54.8%
difference-of-squares54.9%
sub-neg54.9%
Applied egg-rr52.9%
associate-/r/52.9%
*-commutative52.9%
+-commutative52.9%
+-commutative52.9%
Simplified52.9%
associate-/l*52.9%
unpow252.9%
associate-*l*88.7%
+-commutative88.7%
+-commutative88.7%
associate-/l/88.7%
+-commutative88.7%
Applied egg-rr88.7%
Final simplification88.6%
(FPCore (x y)
:precision binary64
(if (<= x -1.75e+14)
(- x (* 0.5 (+ x y)))
(if (<= x 6.2e-34)
(+ x (/ (fabs y) 2.0))
(+ x (* (+ x y) (* (+ x y) (/ 1.0 (* 2.0 (+ x y)))))))))
double code(double x, double y) {
double tmp;
if (x <= -1.75e+14) {
tmp = x - (0.5 * (x + y));
} else if (x <= 6.2e-34) {
tmp = x + (fabs(y) / 2.0);
} else {
tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y)))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.75d+14)) then
tmp = x - (0.5d0 * (x + y))
else if (x <= 6.2d-34) then
tmp = x + (abs(y) / 2.0d0)
else
tmp = x + ((x + y) * ((x + y) * (1.0d0 / (2.0d0 * (x + y)))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.75e+14) {
tmp = x - (0.5 * (x + y));
} else if (x <= 6.2e-34) {
tmp = x + (Math.abs(y) / 2.0);
} else {
tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y)))));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.75e+14: tmp = x - (0.5 * (x + y)) elif x <= 6.2e-34: tmp = x + (math.fabs(y) / 2.0) else: tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y))))) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.75e+14) tmp = Float64(x - Float64(0.5 * Float64(x + y))); elseif (x <= 6.2e-34) tmp = Float64(x + Float64(abs(y) / 2.0)); else tmp = Float64(x + Float64(Float64(x + y) * Float64(Float64(x + y) * Float64(1.0 / Float64(2.0 * Float64(x + y)))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.75e+14) tmp = x - (0.5 * (x + y)); elseif (x <= 6.2e-34) tmp = x + (abs(y) / 2.0); else tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y))))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.75e+14], N[(x - N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e-34], N[(x + N[(N[Abs[y], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(x + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(1.0 / N[(2.0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+14}:\\
\;\;\;\;x - 0.5 \cdot \left(x + y\right)\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-34}:\\
\;\;\;\;x + \frac{\left|y\right|}{2}\\
\mathbf{else}:\\
\;\;\;\;x + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \frac{1}{2 \cdot \left(x + y\right)}\right)\\
\end{array}
\end{array}
if x < -1.75e14Initial program 99.9%
Taylor expanded in x around inf 99.9%
*-inverses99.9%
div-sub99.9%
add-sqr-sqrt0.0%
associate-/r*0.0%
Applied egg-rr0.0%
div-inv0.0%
metadata-eval0.0%
Applied egg-rr92.1%
associate-*r*92.1%
associate-*r/36.3%
*-commutative36.3%
associate-/l*92.1%
*-inverses92.1%
*-rgt-identity92.1%
*-commutative92.1%
+-commutative92.1%
Simplified92.1%
if -1.75e14 < x < 6.1999999999999996e-34Initial program 100.0%
Taylor expanded in y around inf 84.1%
if 6.1999999999999996e-34 < x Initial program 99.7%
add-cube-cbrt99.0%
fabs-mul99.0%
pow299.0%
Applied egg-rr99.0%
unpow299.0%
fabs-sqr99.0%
Applied egg-rr99.0%
unpow299.0%
Simplified99.0%
add-sqr-sqrt15.5%
fabs-sqr15.5%
unpow215.5%
add-sqr-sqrt28.0%
add-cube-cbrt28.2%
sub-neg28.2%
add-sqr-sqrt0.0%
sqrt-unprod48.9%
sqr-neg48.9%
sqrt-unprod82.4%
add-sqr-sqrt82.4%
flip-+40.7%
clear-num40.7%
sub-neg40.7%
add-sqr-sqrt0.0%
sqrt-unprod14.2%
sqr-neg14.2%
sqrt-unprod14.2%
add-sqr-sqrt14.2%
difference-of-squares14.2%
sub-neg14.2%
Applied egg-rr41.1%
associate-/r/41.1%
*-commutative41.1%
+-commutative41.1%
+-commutative41.1%
Simplified41.1%
associate-/l*41.1%
unpow241.1%
associate-*l*82.4%
+-commutative82.4%
+-commutative82.4%
associate-/l/82.4%
+-commutative82.4%
Applied egg-rr82.4%
Final simplification85.4%
(FPCore (x y)
:precision binary64
(if (<= x -1.45e-70)
(- x (* 0.5 (+ x y)))
(if (<= x 1.35e-31)
(* 0.5 (fabs y))
(+ x (* (+ x y) (* (+ x y) (/ 1.0 (* 2.0 (+ x y)))))))))
double code(double x, double y) {
double tmp;
if (x <= -1.45e-70) {
tmp = x - (0.5 * (x + y));
} else if (x <= 1.35e-31) {
tmp = 0.5 * fabs(y);
} else {
tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y)))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.45d-70)) then
tmp = x - (0.5d0 * (x + y))
else if (x <= 1.35d-31) then
tmp = 0.5d0 * abs(y)
else
tmp = x + ((x + y) * ((x + y) * (1.0d0 / (2.0d0 * (x + y)))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.45e-70) {
tmp = x - (0.5 * (x + y));
} else if (x <= 1.35e-31) {
tmp = 0.5 * Math.abs(y);
} else {
tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y)))));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.45e-70: tmp = x - (0.5 * (x + y)) elif x <= 1.35e-31: tmp = 0.5 * math.fabs(y) else: tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y))))) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.45e-70) tmp = Float64(x - Float64(0.5 * Float64(x + y))); elseif (x <= 1.35e-31) tmp = Float64(0.5 * abs(y)); else tmp = Float64(x + Float64(Float64(x + y) * Float64(Float64(x + y) * Float64(1.0 / Float64(2.0 * Float64(x + y)))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.45e-70) tmp = x - (0.5 * (x + y)); elseif (x <= 1.35e-31) tmp = 0.5 * abs(y); else tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y))))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.45e-70], N[(x - N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e-31], N[(0.5 * N[Abs[y], $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(x + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(1.0 / N[(2.0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-70}:\\
\;\;\;\;x - 0.5 \cdot \left(x + y\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-31}:\\
\;\;\;\;0.5 \cdot \left|y\right|\\
\mathbf{else}:\\
\;\;\;\;x + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \frac{1}{2 \cdot \left(x + y\right)}\right)\\
\end{array}
\end{array}
if x < -1.44999999999999986e-70Initial program 99.9%
Taylor expanded in x around inf 98.7%
*-inverses98.7%
div-sub98.7%
add-sqr-sqrt0.0%
associate-/r*0.0%
Applied egg-rr0.0%
div-inv0.0%
metadata-eval0.0%
Applied egg-rr86.7%
associate-*r*86.7%
associate-*r/42.1%
*-commutative42.1%
associate-/l*86.7%
*-inverses86.7%
*-rgt-identity86.7%
*-commutative86.7%
+-commutative86.7%
Simplified86.7%
if -1.44999999999999986e-70 < x < 1.35000000000000007e-31Initial program 100.0%
Taylor expanded in y around inf 86.6%
Taylor expanded in x around 0 84.4%
if 1.35000000000000007e-31 < x Initial program 99.7%
add-cube-cbrt99.0%
fabs-mul99.0%
pow299.0%
Applied egg-rr99.0%
unpow299.0%
fabs-sqr99.0%
Applied egg-rr99.0%
unpow299.0%
Simplified99.0%
add-sqr-sqrt15.5%
fabs-sqr15.5%
unpow215.5%
add-sqr-sqrt28.0%
add-cube-cbrt28.2%
sub-neg28.2%
add-sqr-sqrt0.0%
sqrt-unprod48.9%
sqr-neg48.9%
sqrt-unprod82.4%
add-sqr-sqrt82.4%
flip-+40.7%
clear-num40.7%
sub-neg40.7%
add-sqr-sqrt0.0%
sqrt-unprod14.2%
sqr-neg14.2%
sqrt-unprod14.2%
add-sqr-sqrt14.2%
difference-of-squares14.2%
sub-neg14.2%
Applied egg-rr41.1%
associate-/r/41.1%
*-commutative41.1%
+-commutative41.1%
+-commutative41.1%
Simplified41.1%
associate-/l*41.1%
unpow241.1%
associate-*l*82.4%
+-commutative82.4%
+-commutative82.4%
associate-/l/82.4%
+-commutative82.4%
Applied egg-rr82.4%
Final simplification84.5%
(FPCore (x y) :precision binary64 (if (<= y -9e-208) (- x (* 0.5 (+ x y))) (+ x (* (+ x y) (* (+ x y) (/ 1.0 (* 2.0 (+ x y))))))))
double code(double x, double y) {
double tmp;
if (y <= -9e-208) {
tmp = x - (0.5 * (x + y));
} else {
tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (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 <= (-9d-208)) then
tmp = x - (0.5d0 * (x + y))
else
tmp = x + ((x + y) * ((x + y) * (1.0d0 / (2.0d0 * (x + y)))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -9e-208) {
tmp = x - (0.5 * (x + y));
} else {
tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y)))));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -9e-208: tmp = x - (0.5 * (x + y)) else: tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y))))) return tmp
function code(x, y) tmp = 0.0 if (y <= -9e-208) tmp = Float64(x - Float64(0.5 * Float64(x + y))); else tmp = Float64(x + Float64(Float64(x + y) * Float64(Float64(x + y) * Float64(1.0 / Float64(2.0 * Float64(x + y)))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -9e-208) tmp = x - (0.5 * (x + y)); else tmp = x + ((x + y) * ((x + y) * (1.0 / (2.0 * (x + y))))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -9e-208], N[(x - N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(x + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(1.0 / N[(2.0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-208}:\\
\;\;\;\;x - 0.5 \cdot \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \frac{1}{2 \cdot \left(x + y\right)}\right)\\
\end{array}
\end{array}
if y < -8.9999999999999992e-208Initial program 99.9%
Taylor expanded in x around inf 85.5%
*-inverses85.5%
div-sub85.5%
add-sqr-sqrt41.5%
associate-/r*41.6%
Applied egg-rr41.6%
div-inv41.6%
metadata-eval41.6%
Applied egg-rr71.1%
associate-*r*71.1%
associate-*r/56.8%
*-commutative56.8%
associate-/l*85.6%
*-inverses85.6%
*-rgt-identity85.6%
*-commutative85.6%
+-commutative85.6%
Simplified85.6%
if -8.9999999999999992e-208 < y Initial program 99.8%
add-cube-cbrt98.3%
fabs-mul98.3%
pow298.3%
Applied egg-rr98.3%
unpow298.3%
fabs-sqr98.3%
Applied egg-rr98.3%
unpow298.3%
Simplified98.3%
add-sqr-sqrt65.7%
fabs-sqr65.7%
unpow265.7%
add-sqr-sqrt71.4%
add-cube-cbrt72.7%
sub-neg72.7%
add-sqr-sqrt43.9%
sqrt-unprod70.3%
sqr-neg70.3%
sqrt-unprod53.4%
add-sqr-sqrt77.3%
flip-+48.2%
clear-num48.1%
sub-neg48.1%
add-sqr-sqrt15.3%
sqrt-unprod34.9%
sqr-neg34.9%
sqrt-unprod20.4%
add-sqr-sqrt44.2%
difference-of-squares44.2%
sub-neg44.2%
Applied egg-rr48.3%
associate-/r/48.4%
*-commutative48.4%
+-commutative48.4%
+-commutative48.4%
Simplified48.4%
associate-/l*48.4%
unpow248.4%
associate-*l*77.2%
+-commutative77.2%
+-commutative77.2%
associate-/l/77.2%
+-commutative77.2%
Applied egg-rr77.2%
Final simplification80.6%
(FPCore (x y) :precision binary64 (let* ((t_0 (* 0.5 (+ x y)))) (if (<= y -4e-208) (- x t_0) (if (<= y 7.4e-245) (* x 1.5) t_0))))
double code(double x, double y) {
double t_0 = 0.5 * (x + y);
double tmp;
if (y <= -4e-208) {
tmp = x - t_0;
} else if (y <= 7.4e-245) {
tmp = x * 1.5;
} else {
tmp = t_0;
}
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 = 0.5d0 * (x + y)
if (y <= (-4d-208)) then
tmp = x - t_0
else if (y <= 7.4d-245) then
tmp = x * 1.5d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.5 * (x + y);
double tmp;
if (y <= -4e-208) {
tmp = x - t_0;
} else if (y <= 7.4e-245) {
tmp = x * 1.5;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.5 * (x + y) tmp = 0 if y <= -4e-208: tmp = x - t_0 elif y <= 7.4e-245: tmp = x * 1.5 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.5 * Float64(x + y)) tmp = 0.0 if (y <= -4e-208) tmp = Float64(x - t_0); elseif (y <= 7.4e-245) tmp = Float64(x * 1.5); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.5 * (x + y); tmp = 0.0; if (y <= -4e-208) tmp = x - t_0; elseif (y <= 7.4e-245) tmp = x * 1.5; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e-208], N[(x - t$95$0), $MachinePrecision], If[LessEqual[y, 7.4e-245], N[(x * 1.5), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(x + y\right)\\
\mathbf{if}\;y \leq -4 \cdot 10^{-208}:\\
\;\;\;\;x - t\_0\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-245}:\\
\;\;\;\;x \cdot 1.5\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -4.0000000000000004e-208Initial program 99.9%
Taylor expanded in x around inf 85.5%
*-inverses85.5%
div-sub85.5%
add-sqr-sqrt41.5%
associate-/r*41.6%
Applied egg-rr41.6%
div-inv41.6%
metadata-eval41.6%
Applied egg-rr71.1%
associate-*r*71.1%
associate-*r/56.8%
*-commutative56.8%
associate-/l*85.6%
*-inverses85.6%
*-rgt-identity85.6%
*-commutative85.6%
+-commutative85.6%
Simplified85.6%
if -4.0000000000000004e-208 < y < 7.4000000000000005e-245Initial program 99.8%
Taylor expanded in y around 0 91.6%
neg-mul-191.6%
Simplified91.6%
Taylor expanded in x around 0 91.6%
*-rgt-identity91.6%
*-commutative91.6%
fabs-neg91.6%
rem-square-sqrt66.2%
fabs-sqr66.2%
rem-square-sqrt71.0%
metadata-eval71.0%
*-inverses71.0%
rem-square-sqrt66.2%
fabs-sqr66.2%
rem-square-sqrt91.6%
fabs-neg91.6%
distribute-lft-in91.6%
fabs-neg91.6%
rem-square-sqrt66.3%
fabs-sqr66.3%
rem-square-sqrt71.0%
*-inverses71.0%
metadata-eval71.0%
metadata-eval71.0%
Simplified71.0%
if 7.4000000000000005e-245 < y Initial program 99.9%
Taylor expanded in x around inf 84.7%
+-commutative84.7%
sub-neg84.7%
neg-mul-184.7%
fma-define84.7%
neg-mul-184.7%
sub-neg84.7%
rem-square-sqrt60.9%
fabs-sqr60.9%
rem-square-sqrt65.6%
Simplified65.6%
Taylor expanded in x around 0 80.8%
distribute-lft-out80.8%
+-commutative80.8%
Simplified80.8%
Final simplification81.7%
(FPCore (x y) :precision binary64 (if (<= y -2.5e-207) (- x (* y 0.5)) (if (<= y 1.2e-256) (* x 1.5) (* 0.5 (+ x y)))))
double code(double x, double y) {
double tmp;
if (y <= -2.5e-207) {
tmp = x - (y * 0.5);
} else if (y <= 1.2e-256) {
tmp = x * 1.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 <= (-2.5d-207)) then
tmp = x - (y * 0.5d0)
else if (y <= 1.2d-256) then
tmp = x * 1.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 <= -2.5e-207) {
tmp = x - (y * 0.5);
} else if (y <= 1.2e-256) {
tmp = x * 1.5;
} else {
tmp = 0.5 * (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.5e-207: tmp = x - (y * 0.5) elif y <= 1.2e-256: tmp = x * 1.5 else: tmp = 0.5 * (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.5e-207) tmp = Float64(x - Float64(y * 0.5)); elseif (y <= 1.2e-256) tmp = Float64(x * 1.5); else tmp = Float64(0.5 * Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.5e-207) tmp = x - (y * 0.5); elseif (y <= 1.2e-256) tmp = x * 1.5; else tmp = 0.5 * (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.5e-207], N[(x - N[(y * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-256], N[(x * 1.5), $MachinePrecision], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-207}:\\
\;\;\;\;x - y \cdot 0.5\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-256}:\\
\;\;\;\;x \cdot 1.5\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\end{array}
\end{array}
if y < -2.50000000000000007e-207Initial program 99.9%
Taylor expanded in x around inf 85.5%
*-inverses85.5%
div-sub85.5%
add-sqr-sqrt41.5%
associate-/r*41.6%
Applied egg-rr41.6%
div-inv41.6%
metadata-eval41.6%
Applied egg-rr71.1%
associate-*r*71.1%
associate-*r/56.8%
*-commutative56.8%
associate-/l*85.6%
*-inverses85.6%
*-rgt-identity85.6%
*-commutative85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in x around 0 70.2%
if -2.50000000000000007e-207 < y < 1.2e-256Initial program 99.8%
Taylor expanded in y around 0 91.6%
neg-mul-191.6%
Simplified91.6%
Taylor expanded in x around 0 91.6%
*-rgt-identity91.6%
*-commutative91.6%
fabs-neg91.6%
rem-square-sqrt66.2%
fabs-sqr66.2%
rem-square-sqrt71.0%
metadata-eval71.0%
*-inverses71.0%
rem-square-sqrt66.2%
fabs-sqr66.2%
rem-square-sqrt91.6%
fabs-neg91.6%
distribute-lft-in91.6%
fabs-neg91.6%
rem-square-sqrt66.3%
fabs-sqr66.3%
rem-square-sqrt71.0%
*-inverses71.0%
metadata-eval71.0%
metadata-eval71.0%
Simplified71.0%
if 1.2e-256 < y Initial program 99.9%
Taylor expanded in x around inf 84.7%
+-commutative84.7%
sub-neg84.7%
neg-mul-184.7%
fma-define84.7%
neg-mul-184.7%
sub-neg84.7%
rem-square-sqrt60.9%
fabs-sqr60.9%
rem-square-sqrt65.6%
Simplified65.6%
Taylor expanded in x around 0 80.8%
distribute-lft-out80.8%
+-commutative80.8%
Simplified80.8%
Final simplification75.4%
(FPCore (x y) :precision binary64 (if (<= y -3.3e-195) (* y -0.5) (if (<= y 1e-249) (* x 1.5) (* 0.5 (+ x y)))))
double code(double x, double y) {
double tmp;
if (y <= -3.3e-195) {
tmp = y * -0.5;
} else if (y <= 1e-249) {
tmp = x * 1.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 <= (-3.3d-195)) then
tmp = y * (-0.5d0)
else if (y <= 1d-249) then
tmp = x * 1.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 <= -3.3e-195) {
tmp = y * -0.5;
} else if (y <= 1e-249) {
tmp = x * 1.5;
} else {
tmp = 0.5 * (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.3e-195: tmp = y * -0.5 elif y <= 1e-249: tmp = x * 1.5 else: tmp = 0.5 * (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.3e-195) tmp = Float64(y * -0.5); elseif (y <= 1e-249) tmp = Float64(x * 1.5); else tmp = Float64(0.5 * Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.3e-195) tmp = y * -0.5; elseif (y <= 1e-249) tmp = x * 1.5; else tmp = 0.5 * (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.3e-195], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 1e-249], N[(x * 1.5), $MachinePrecision], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-195}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 10^{-249}:\\
\;\;\;\;x \cdot 1.5\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\end{array}
\end{array}
if y < -3.3e-195Initial program 99.9%
Taylor expanded in x around inf 85.2%
*-inverses85.2%
div-sub85.2%
add-sqr-sqrt42.3%
associate-/r*42.4%
Applied egg-rr42.4%
div-inv42.4%
metadata-eval42.4%
Applied egg-rr70.6%
associate-*r*70.6%
associate-*r/55.9%
*-commutative55.9%
associate-/l*85.3%
*-inverses85.3%
*-rgt-identity85.3%
*-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 65.6%
*-commutative65.6%
Simplified65.6%
if -3.3e-195 < y < 1.00000000000000005e-249Initial program 99.8%
Taylor expanded in y around 0 92.1%
neg-mul-192.1%
Simplified92.1%
Taylor expanded in x around 0 92.1%
*-rgt-identity92.1%
*-commutative92.1%
fabs-neg92.1%
rem-square-sqrt61.8%
fabs-sqr61.8%
rem-square-sqrt67.4%
metadata-eval67.4%
*-inverses67.4%
rem-square-sqrt61.8%
fabs-sqr61.8%
rem-square-sqrt92.1%
fabs-neg92.1%
distribute-lft-in92.1%
fabs-neg92.1%
rem-square-sqrt61.9%
fabs-sqr61.9%
rem-square-sqrt67.4%
*-inverses67.4%
metadata-eval67.4%
metadata-eval67.4%
Simplified67.4%
if 1.00000000000000005e-249 < y Initial program 99.9%
Taylor expanded in x around inf 84.7%
+-commutative84.7%
sub-neg84.7%
neg-mul-184.7%
fma-define84.7%
neg-mul-184.7%
sub-neg84.7%
rem-square-sqrt60.9%
fabs-sqr60.9%
rem-square-sqrt65.6%
Simplified65.6%
Taylor expanded in x around 0 80.8%
distribute-lft-out80.8%
+-commutative80.8%
Simplified80.8%
Final simplification73.1%
(FPCore (x y) :precision binary64 (if (<= y -3.3e-195) (* y -0.5) (if (<= y 6.9e-77) (* x 1.5) (* y 0.5))))
double code(double x, double y) {
double tmp;
if (y <= -3.3e-195) {
tmp = y * -0.5;
} else if (y <= 6.9e-77) {
tmp = x * 1.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 <= (-3.3d-195)) then
tmp = y * (-0.5d0)
else if (y <= 6.9d-77) then
tmp = x * 1.5d0
else
tmp = y * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.3e-195) {
tmp = y * -0.5;
} else if (y <= 6.9e-77) {
tmp = x * 1.5;
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.3e-195: tmp = y * -0.5 elif y <= 6.9e-77: tmp = x * 1.5 else: tmp = y * 0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= -3.3e-195) tmp = Float64(y * -0.5); elseif (y <= 6.9e-77) tmp = Float64(x * 1.5); else tmp = Float64(y * 0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.3e-195) tmp = y * -0.5; elseif (y <= 6.9e-77) tmp = x * 1.5; else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.3e-195], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 6.9e-77], N[(x * 1.5), $MachinePrecision], N[(y * 0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-195}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 6.9 \cdot 10^{-77}:\\
\;\;\;\;x \cdot 1.5\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < -3.3e-195Initial program 99.9%
Taylor expanded in x around inf 85.2%
*-inverses85.2%
div-sub85.2%
add-sqr-sqrt42.3%
associate-/r*42.4%
Applied egg-rr42.4%
div-inv42.4%
metadata-eval42.4%
Applied egg-rr70.6%
associate-*r*70.6%
associate-*r/55.9%
*-commutative55.9%
associate-/l*85.3%
*-inverses85.3%
*-rgt-identity85.3%
*-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 65.6%
*-commutative65.6%
Simplified65.6%
if -3.3e-195 < y < 6.90000000000000034e-77Initial program 99.8%
Taylor expanded in y around 0 92.4%
neg-mul-192.4%
Simplified92.4%
Taylor expanded in x around 0 92.4%
*-rgt-identity92.4%
*-commutative92.4%
fabs-neg92.4%
rem-square-sqrt50.8%
fabs-sqr50.8%
rem-square-sqrt58.4%
metadata-eval58.4%
*-inverses58.4%
rem-square-sqrt50.8%
fabs-sqr50.8%
rem-square-sqrt92.4%
fabs-neg92.4%
distribute-lft-in92.4%
fabs-neg92.4%
rem-square-sqrt50.9%
fabs-sqr50.9%
rem-square-sqrt58.4%
*-inverses58.4%
metadata-eval58.4%
metadata-eval58.4%
Simplified58.4%
if 6.90000000000000034e-77 < y Initial program 99.9%
Taylor expanded in y around inf 77.3%
Taylor expanded in x around 0 73.3%
rem-square-sqrt72.7%
fabs-sqr72.7%
rem-square-sqrt73.3%
Simplified73.3%
Final simplification66.1%
(FPCore (x y) :precision binary64 (if (<= x -4.5e-70) (* x 0.5) (if (<= x 7e-71) (* y 0.5) (* x 1.5))))
double code(double x, double y) {
double tmp;
if (x <= -4.5e-70) {
tmp = x * 0.5;
} else if (x <= 7e-71) {
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 <= (-4.5d-70)) then
tmp = x * 0.5d0
else if (x <= 7d-71) 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 <= -4.5e-70) {
tmp = x * 0.5;
} else if (x <= 7e-71) {
tmp = y * 0.5;
} else {
tmp = x * 1.5;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.5e-70: tmp = x * 0.5 elif x <= 7e-71: tmp = y * 0.5 else: tmp = x * 1.5 return tmp
function code(x, y) tmp = 0.0 if (x <= -4.5e-70) tmp = Float64(x * 0.5); elseif (x <= 7e-71) 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 <= -4.5e-70) tmp = x * 0.5; elseif (x <= 7e-71) tmp = y * 0.5; else tmp = x * 1.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.5e-70], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 7e-71], N[(y * 0.5), $MachinePrecision], N[(x * 1.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-70}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-71}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot 1.5\\
\end{array}
\end{array}
if x < -4.50000000000000022e-70Initial program 99.9%
Taylor expanded in x around inf 98.7%
+-commutative98.7%
sub-neg98.7%
neg-mul-198.7%
fma-define98.7%
neg-mul-198.7%
sub-neg98.7%
rem-square-sqrt79.3%
fabs-sqr79.3%
rem-square-sqrt79.9%
Simplified79.9%
Taylor expanded in y around 0 68.5%
if -4.50000000000000022e-70 < x < 6.9999999999999998e-71Initial program 100.0%
Taylor expanded in y around inf 87.8%
Taylor expanded in x around 0 85.9%
rem-square-sqrt46.4%
fabs-sqr46.4%
rem-square-sqrt47.8%
Simplified47.8%
if 6.9999999999999998e-71 < x Initial program 99.7%
Taylor expanded in y around 0 66.6%
neg-mul-166.6%
Simplified66.6%
Taylor expanded in x around 0 66.6%
*-rgt-identity66.6%
*-commutative66.6%
fabs-neg66.6%
rem-square-sqrt66.6%
fabs-sqr66.6%
rem-square-sqrt66.6%
metadata-eval66.6%
*-inverses66.6%
rem-square-sqrt66.6%
fabs-sqr66.6%
rem-square-sqrt66.6%
fabs-neg66.6%
distribute-lft-in66.6%
fabs-neg66.6%
rem-square-sqrt66.6%
fabs-sqr66.6%
rem-square-sqrt66.6%
*-inverses66.6%
metadata-eval66.6%
metadata-eval66.6%
Simplified66.6%
Final simplification60.0%
(FPCore (x y) :precision binary64 (if (<= y 1.88e-84) (* x 0.5) (* y 0.5)))
double code(double x, double y) {
double tmp;
if (y <= 1.88e-84) {
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 <= 1.88d-84) 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 <= 1.88e-84) {
tmp = x * 0.5;
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.88e-84: tmp = x * 0.5 else: tmp = y * 0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= 1.88e-84) 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 <= 1.88e-84) tmp = x * 0.5; else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.88e-84], N[(x * 0.5), $MachinePrecision], N[(y * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.88 \cdot 10^{-84}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < 1.88000000000000004e-84Initial program 99.9%
Taylor expanded in x around inf 91.0%
+-commutative91.0%
sub-neg91.0%
neg-mul-191.0%
fma-define91.0%
neg-mul-191.0%
sub-neg91.0%
rem-square-sqrt29.2%
fabs-sqr29.2%
rem-square-sqrt35.2%
Simplified35.2%
Taylor expanded in y around 0 34.7%
if 1.88000000000000004e-84 < y Initial program 99.9%
Taylor expanded in y around inf 76.8%
Taylor expanded in x around 0 72.8%
rem-square-sqrt72.2%
fabs-sqr72.2%
rem-square-sqrt72.8%
Simplified72.8%
Final simplification47.5%
(FPCore (x y) :precision binary64 (if (<= y 8.8e-86) x (* y 0.5)))
double code(double x, double y) {
double tmp;
if (y <= 8.8e-86) {
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 <= 8.8d-86) 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 <= 8.8e-86) {
tmp = x;
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 8.8e-86: tmp = x else: tmp = y * 0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= 8.8e-86) tmp = x; else tmp = Float64(y * 0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 8.8e-86) tmp = x; else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 8.8e-86], x, N[(y * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.8 \cdot 10^{-86}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < 8.8000000000000006e-86Initial program 99.9%
Taylor expanded in x around inf 12.8%
if 8.8000000000000006e-86 < y Initial program 99.9%
Taylor expanded in y around inf 76.8%
Taylor expanded in x around 0 72.8%
rem-square-sqrt72.2%
fabs-sqr72.2%
rem-square-sqrt72.8%
Simplified72.8%
Final simplification33.0%
(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.0%
herbie shell --seed 2024170
(FPCore (x y)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
:precision binary64
(+ x (/ (fabs (- y x)) 2.0)))