
(FPCore (x y) :precision binary64 (/ (- x y) (- 1.0 y)))
double code(double x, double y) {
return (x - y) / (1.0 - y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (1.0d0 - y)
end function
public static double code(double x, double y) {
return (x - y) / (1.0 - y);
}
def code(x, y): return (x - y) / (1.0 - y)
function code(x, y) return Float64(Float64(x - y) / Float64(1.0 - y)) end
function tmp = code(x, y) tmp = (x - y) / (1.0 - y); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{1 - y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (- x y) (- 1.0 y)))
double code(double x, double y) {
return (x - y) / (1.0 - y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (1.0d0 - y)
end function
public static double code(double x, double y) {
return (x - y) / (1.0 - y);
}
def code(x, y): return (x - y) / (1.0 - y)
function code(x, y) return Float64(Float64(x - y) / Float64(1.0 - y)) end
function tmp = code(x, y) tmp = (x - y) / (1.0 - y); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{1 - y}
\end{array}
(FPCore (x y) :precision binary64 (+ (/ x (- 1.0 y)) (/ y (+ y -1.0))))
double code(double x, double y) {
return (x / (1.0 - y)) + (y / (y + -1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (1.0d0 - y)) + (y / (y + (-1.0d0)))
end function
public static double code(double x, double y) {
return (x / (1.0 - y)) + (y / (y + -1.0));
}
def code(x, y): return (x / (1.0 - y)) + (y / (y + -1.0))
function code(x, y) return Float64(Float64(x / Float64(1.0 - y)) + Float64(y / Float64(y + -1.0))) end
function tmp = code(x, y) tmp = (x / (1.0 - y)) + (y / (y + -1.0)); end
code[x_, y_] := N[(N[(x / N[(1.0 - y), $MachinePrecision]), $MachinePrecision] + N[(y / N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{1 - y} + \frac{y}{y + -1}
\end{array}
Initial program 100.0%
div-sub100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ x y))) (t_1 (/ x (- 1.0 y))))
(if (<= y -235000000.0)
t_0
(if (<= y 7.5e-49)
t_1
(if (<= y 5.2e-32) (- y) (if (<= y 27000000000.0) t_1 t_0))))))
double code(double x, double y) {
double t_0 = 1.0 - (x / y);
double t_1 = x / (1.0 - y);
double tmp;
if (y <= -235000000.0) {
tmp = t_0;
} else if (y <= 7.5e-49) {
tmp = t_1;
} else if (y <= 5.2e-32) {
tmp = -y;
} else if (y <= 27000000000.0) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (x / y)
t_1 = x / (1.0d0 - y)
if (y <= (-235000000.0d0)) then
tmp = t_0
else if (y <= 7.5d-49) then
tmp = t_1
else if (y <= 5.2d-32) then
tmp = -y
else if (y <= 27000000000.0d0) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (x / y);
double t_1 = x / (1.0 - y);
double tmp;
if (y <= -235000000.0) {
tmp = t_0;
} else if (y <= 7.5e-49) {
tmp = t_1;
} else if (y <= 5.2e-32) {
tmp = -y;
} else if (y <= 27000000000.0) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (x / y) t_1 = x / (1.0 - y) tmp = 0 if y <= -235000000.0: tmp = t_0 elif y <= 7.5e-49: tmp = t_1 elif y <= 5.2e-32: tmp = -y elif y <= 27000000000.0: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(x / y)) t_1 = Float64(x / Float64(1.0 - y)) tmp = 0.0 if (y <= -235000000.0) tmp = t_0; elseif (y <= 7.5e-49) tmp = t_1; elseif (y <= 5.2e-32) tmp = Float64(-y); elseif (y <= 27000000000.0) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (x / y); t_1 = x / (1.0 - y); tmp = 0.0; if (y <= -235000000.0) tmp = t_0; elseif (y <= 7.5e-49) tmp = t_1; elseif (y <= 5.2e-32) tmp = -y; elseif (y <= 27000000000.0) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -235000000.0], t$95$0, If[LessEqual[y, 7.5e-49], t$95$1, If[LessEqual[y, 5.2e-32], (-y), If[LessEqual[y, 27000000000.0], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
t_1 := \frac{x}{1 - y}\\
\mathbf{if}\;y \leq -235000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-32}:\\
\;\;\;\;-y\\
\mathbf{elif}\;y \leq 27000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -2.35e8 or 2.7e10 < y Initial program 100.0%
Taylor expanded in y around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
if -2.35e8 < y < 7.4999999999999998e-49 or 5.1999999999999995e-32 < y < 2.7e10Initial program 100.0%
Taylor expanded in x around inf 75.6%
if 7.4999999999999998e-49 < y < 5.1999999999999995e-32Initial program 100.0%
Taylor expanded in x around 0 100.0%
neg-mul-1100.0%
distribute-neg-frac2100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
neg-mul-1100.0%
Simplified100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ x y))) (t_1 (+ x (* x y))))
(if (<= y -0.17)
t_0
(if (<= y 5.9e-49)
t_1
(if (<= y 1.6e-31) (- y) (if (<= y 1.0) t_1 t_0))))))
double code(double x, double y) {
double t_0 = 1.0 - (x / y);
double t_1 = x + (x * y);
double tmp;
if (y <= -0.17) {
tmp = t_0;
} else if (y <= 5.9e-49) {
tmp = t_1;
} else if (y <= 1.6e-31) {
tmp = -y;
} else if (y <= 1.0) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (x / y)
t_1 = x + (x * y)
if (y <= (-0.17d0)) then
tmp = t_0
else if (y <= 5.9d-49) then
tmp = t_1
else if (y <= 1.6d-31) then
tmp = -y
else if (y <= 1.0d0) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (x / y);
double t_1 = x + (x * y);
double tmp;
if (y <= -0.17) {
tmp = t_0;
} else if (y <= 5.9e-49) {
tmp = t_1;
} else if (y <= 1.6e-31) {
tmp = -y;
} else if (y <= 1.0) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (x / y) t_1 = x + (x * y) tmp = 0 if y <= -0.17: tmp = t_0 elif y <= 5.9e-49: tmp = t_1 elif y <= 1.6e-31: tmp = -y elif y <= 1.0: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(x / y)) t_1 = Float64(x + Float64(x * y)) tmp = 0.0 if (y <= -0.17) tmp = t_0; elseif (y <= 5.9e-49) tmp = t_1; elseif (y <= 1.6e-31) tmp = Float64(-y); elseif (y <= 1.0) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (x / y); t_1 = x + (x * y); tmp = 0.0; if (y <= -0.17) tmp = t_0; elseif (y <= 5.9e-49) tmp = t_1; elseif (y <= 1.6e-31) tmp = -y; elseif (y <= 1.0) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.17], t$95$0, If[LessEqual[y, 5.9e-49], t$95$1, If[LessEqual[y, 1.6e-31], (-y), If[LessEqual[y, 1.0], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
t_1 := x + x \cdot y\\
\mathbf{if}\;y \leq -0.17:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 5.9 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-31}:\\
\;\;\;\;-y\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -0.170000000000000012 or 1 < y Initial program 100.0%
Taylor expanded in y around inf 96.7%
neg-mul-196.7%
Simplified96.7%
Taylor expanded in x around 0 96.7%
neg-mul-196.7%
unsub-neg96.7%
Simplified96.7%
if -0.170000000000000012 < y < 5.90000000000000037e-49 or 1.60000000000000009e-31 < y < 1Initial program 100.0%
Taylor expanded in x around inf 75.5%
Taylor expanded in y around 0 75.3%
*-commutative75.3%
Simplified75.3%
if 5.90000000000000037e-49 < y < 1.60000000000000009e-31Initial program 100.0%
Taylor expanded in x around 0 100.0%
neg-mul-1100.0%
distribute-neg-frac2100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
neg-mul-1100.0%
Simplified100.0%
Final simplification85.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (* x y))))
(if (<= y -0.75)
1.0
(if (<= y 6.8e-49)
t_0
(if (<= y 1.65e-31) (- y) (if (<= y 1.0) t_0 1.0))))))
double code(double x, double y) {
double t_0 = x + (x * y);
double tmp;
if (y <= -0.75) {
tmp = 1.0;
} else if (y <= 6.8e-49) {
tmp = t_0;
} else if (y <= 1.65e-31) {
tmp = -y;
} else if (y <= 1.0) {
tmp = t_0;
} else {
tmp = 1.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 = x + (x * y)
if (y <= (-0.75d0)) then
tmp = 1.0d0
else if (y <= 6.8d-49) then
tmp = t_0
else if (y <= 1.65d-31) then
tmp = -y
else if (y <= 1.0d0) then
tmp = t_0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (x * y);
double tmp;
if (y <= -0.75) {
tmp = 1.0;
} else if (y <= 6.8e-49) {
tmp = t_0;
} else if (y <= 1.65e-31) {
tmp = -y;
} else if (y <= 1.0) {
tmp = t_0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): t_0 = x + (x * y) tmp = 0 if y <= -0.75: tmp = 1.0 elif y <= 6.8e-49: tmp = t_0 elif y <= 1.65e-31: tmp = -y elif y <= 1.0: tmp = t_0 else: tmp = 1.0 return tmp
function code(x, y) t_0 = Float64(x + Float64(x * y)) tmp = 0.0 if (y <= -0.75) tmp = 1.0; elseif (y <= 6.8e-49) tmp = t_0; elseif (y <= 1.65e-31) tmp = Float64(-y); elseif (y <= 1.0) tmp = t_0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + (x * y); tmp = 0.0; if (y <= -0.75) tmp = 1.0; elseif (y <= 6.8e-49) tmp = t_0; elseif (y <= 1.65e-31) tmp = -y; elseif (y <= 1.0) tmp = t_0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.75], 1.0, If[LessEqual[y, 6.8e-49], t$95$0, If[LessEqual[y, 1.65e-31], (-y), If[LessEqual[y, 1.0], t$95$0, 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + x \cdot y\\
\mathbf{if}\;y \leq -0.75:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-49}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-31}:\\
\;\;\;\;-y\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -0.75 or 1 < y Initial program 100.0%
Taylor expanded in y around inf 79.0%
if -0.75 < y < 6.8000000000000001e-49 or 1.65e-31 < y < 1Initial program 100.0%
Taylor expanded in x around inf 75.5%
Taylor expanded in y around 0 75.3%
*-commutative75.3%
Simplified75.3%
if 6.8000000000000001e-49 < y < 1.65e-31Initial program 100.0%
Taylor expanded in x around 0 100.0%
neg-mul-1100.0%
distribute-neg-frac2100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
neg-mul-1100.0%
Simplified100.0%
Final simplification77.5%
(FPCore (x y) :precision binary64 (if (<= y -66000.0) 1.0 (if (<= y 5.8e-49) x (if (<= y 1.3e-30) (- y) (if (<= y 1.0) x 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -66000.0) {
tmp = 1.0;
} else if (y <= 5.8e-49) {
tmp = x;
} else if (y <= 1.3e-30) {
tmp = -y;
} else if (y <= 1.0) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-66000.0d0)) then
tmp = 1.0d0
else if (y <= 5.8d-49) then
tmp = x
else if (y <= 1.3d-30) then
tmp = -y
else if (y <= 1.0d0) then
tmp = x
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -66000.0) {
tmp = 1.0;
} else if (y <= 5.8e-49) {
tmp = x;
} else if (y <= 1.3e-30) {
tmp = -y;
} else if (y <= 1.0) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -66000.0: tmp = 1.0 elif y <= 5.8e-49: tmp = x elif y <= 1.3e-30: tmp = -y elif y <= 1.0: tmp = x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -66000.0) tmp = 1.0; elseif (y <= 5.8e-49) tmp = x; elseif (y <= 1.3e-30) tmp = Float64(-y); elseif (y <= 1.0) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -66000.0) tmp = 1.0; elseif (y <= 5.8e-49) tmp = x; elseif (y <= 1.3e-30) tmp = -y; elseif (y <= 1.0) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -66000.0], 1.0, If[LessEqual[y, 5.8e-49], x, If[LessEqual[y, 1.3e-30], (-y), If[LessEqual[y, 1.0], x, 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -66000:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-49}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-30}:\\
\;\;\;\;-y\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -66000 or 1 < y Initial program 100.0%
Taylor expanded in y around inf 80.2%
if -66000 < y < 5.8e-49 or 1.29999999999999993e-30 < y < 1Initial program 100.0%
Taylor expanded in y around 0 73.6%
if 5.8e-49 < y < 1.29999999999999993e-30Initial program 100.0%
Taylor expanded in x around 0 100.0%
neg-mul-1100.0%
distribute-neg-frac2100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
neg-mul-1100.0%
Simplified100.0%
(FPCore (x y) :precision binary64 (if (or (<= y -0.82) (not (<= y 1.0))) (- 1.0 (/ x y)) (+ x (* y (+ x -1.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -0.82) || !(y <= 1.0)) {
tmp = 1.0 - (x / y);
} else {
tmp = x + (y * (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 ((y <= (-0.82d0)) .or. (.not. (y <= 1.0d0))) then
tmp = 1.0d0 - (x / y)
else
tmp = x + (y * (x + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -0.82) || !(y <= 1.0)) {
tmp = 1.0 - (x / y);
} else {
tmp = x + (y * (x + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -0.82) or not (y <= 1.0): tmp = 1.0 - (x / y) else: tmp = x + (y * (x + -1.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -0.82) || !(y <= 1.0)) tmp = Float64(1.0 - Float64(x / y)); else tmp = Float64(x + Float64(y * Float64(x + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -0.82) || ~((y <= 1.0))) tmp = 1.0 - (x / y); else tmp = x + (y * (x + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -0.82], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.82 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(x + -1\right)\\
\end{array}
\end{array}
if y < -0.819999999999999951 or 1 < y Initial program 100.0%
Taylor expanded in y around inf 96.7%
neg-mul-196.7%
Simplified96.7%
Taylor expanded in x around 0 96.7%
neg-mul-196.7%
unsub-neg96.7%
Simplified96.7%
if -0.819999999999999951 < y < 1Initial program 100.0%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
mul-1-neg99.4%
sub-neg99.4%
Simplified99.4%
Final simplification98.1%
(FPCore (x y) :precision binary64 (if (<= y -66000.0) 1.0 (if (<= y 1.0) x 1.0)))
double code(double x, double y) {
double tmp;
if (y <= -66000.0) {
tmp = 1.0;
} else if (y <= 1.0) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-66000.0d0)) then
tmp = 1.0d0
else if (y <= 1.0d0) then
tmp = x
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -66000.0) {
tmp = 1.0;
} else if (y <= 1.0) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -66000.0: tmp = 1.0 elif y <= 1.0: tmp = x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -66000.0) tmp = 1.0; elseif (y <= 1.0) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -66000.0) tmp = 1.0; elseif (y <= 1.0) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -66000.0], 1.0, If[LessEqual[y, 1.0], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -66000:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -66000 or 1 < y Initial program 100.0%
Taylor expanded in y around inf 80.2%
if -66000 < y < 1Initial program 100.0%
Taylor expanded in y around 0 71.1%
(FPCore (x y) :precision binary64 (/ (- x y) (- 1.0 y)))
double code(double x, double y) {
return (x - y) / (1.0 - y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (1.0d0 - y)
end function
public static double code(double x, double y) {
return (x - y) / (1.0 - y);
}
def code(x, y): return (x - y) / (1.0 - y)
function code(x, y) return Float64(Float64(x - y) / Float64(1.0 - y)) end
function tmp = code(x, y) tmp = (x - y) / (1.0 - y); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{1 - y}
\end{array}
Initial program 100.0%
(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 100.0%
Taylor expanded in y around inf 39.3%
herbie shell --seed 2024111
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, C"
:precision binary64
(/ (- x y) (- 1.0 y)))