
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
end function
public static double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
def code(x, y): return 1.0 - (((1.0 - x) * y) / (y + 1.0))
function code(x, y) return Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) end
function tmp = code(x, y) tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)); end
code[x_, y_] := N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
end function
public static double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
def code(x, y): return 1.0 - (((1.0 - x) * y) / (y + 1.0))
function code(x, y) return Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) end
function tmp = code(x, y) tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)); end
code[x_, y_] := N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\end{array}
(FPCore (x y)
:precision binary64
(if (<= y -270000000.0)
(+ x (- (/ 1.0 y) (/ (/ 1.0 y) y)))
(if (<= y 125000000.0)
(+ 1.0 (/ (* y (+ x -1.0)) (+ y 1.0)))
(+ x (/ (- 1.0 x) y)))))
double code(double x, double y) {
double tmp;
if (y <= -270000000.0) {
tmp = x + ((1.0 / y) - ((1.0 / y) / y));
} else if (y <= 125000000.0) {
tmp = 1.0 + ((y * (x + -1.0)) / (y + 1.0));
} else {
tmp = x + ((1.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 <= (-270000000.0d0)) then
tmp = x + ((1.0d0 / y) - ((1.0d0 / y) / y))
else if (y <= 125000000.0d0) then
tmp = 1.0d0 + ((y * (x + (-1.0d0))) / (y + 1.0d0))
else
tmp = x + ((1.0d0 - x) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -270000000.0) {
tmp = x + ((1.0 / y) - ((1.0 / y) / y));
} else if (y <= 125000000.0) {
tmp = 1.0 + ((y * (x + -1.0)) / (y + 1.0));
} else {
tmp = x + ((1.0 - x) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -270000000.0: tmp = x + ((1.0 / y) - ((1.0 / y) / y)) elif y <= 125000000.0: tmp = 1.0 + ((y * (x + -1.0)) / (y + 1.0)) else: tmp = x + ((1.0 - x) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -270000000.0) tmp = Float64(x + Float64(Float64(1.0 / y) - Float64(Float64(1.0 / y) / y))); elseif (y <= 125000000.0) tmp = Float64(1.0 + Float64(Float64(y * Float64(x + -1.0)) / Float64(y + 1.0))); else tmp = Float64(x + Float64(Float64(1.0 - x) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -270000000.0) tmp = x + ((1.0 / y) - ((1.0 / y) / y)); elseif (y <= 125000000.0) tmp = 1.0 + ((y * (x + -1.0)) / (y + 1.0)); else tmp = x + ((1.0 - x) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -270000000.0], N[(x + N[(N[(1.0 / y), $MachinePrecision] - N[(N[(1.0 / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 125000000.0], N[(1.0 + N[(N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -270000000:\\
\;\;\;\;x + \left(\frac{1}{y} - \frac{\frac{1}{y}}{y}\right)\\
\mathbf{elif}\;y \leq 125000000:\\
\;\;\;\;1 + \frac{y \cdot \left(x + -1\right)}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\end{array}
\end{array}
if y < -2.7e8Initial program 25.7%
associate-/l*52.7%
remove-double-neg52.7%
remove-double-neg52.7%
+-commutative52.7%
Simplified52.7%
Taylor expanded in y around inf 100.0%
Simplified99.9%
associate-+l-99.9%
div-sub100.0%
div-inv100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
sub-neg100.0%
div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
if -2.7e8 < y < 1.25e8Initial program 100.0%
if 1.25e8 < y Initial program 33.5%
associate-/l*50.1%
remove-double-neg50.1%
remove-double-neg50.1%
+-commutative50.1%
Simplified50.1%
Taylor expanded in y around inf 100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(if (<= y -1e+52)
x
(if (<= y -1.5e+23)
(/ 1.0 y)
(if (<= y -1.0)
x
(if (<= y -6e-49)
(- 1.0 y)
(if (<= y -1e-59) (* y x) (if (<= y 0.00125) (- 1.0 y) x)))))))
double code(double x, double y) {
double tmp;
if (y <= -1e+52) {
tmp = x;
} else if (y <= -1.5e+23) {
tmp = 1.0 / y;
} else if (y <= -1.0) {
tmp = x;
} else if (y <= -6e-49) {
tmp = 1.0 - y;
} else if (y <= -1e-59) {
tmp = y * x;
} else if (y <= 0.00125) {
tmp = 1.0 - y;
} 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 (y <= (-1d+52)) then
tmp = x
else if (y <= (-1.5d+23)) then
tmp = 1.0d0 / y
else if (y <= (-1.0d0)) then
tmp = x
else if (y <= (-6d-49)) then
tmp = 1.0d0 - y
else if (y <= (-1d-59)) then
tmp = y * x
else if (y <= 0.00125d0) then
tmp = 1.0d0 - y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1e+52) {
tmp = x;
} else if (y <= -1.5e+23) {
tmp = 1.0 / y;
} else if (y <= -1.0) {
tmp = x;
} else if (y <= -6e-49) {
tmp = 1.0 - y;
} else if (y <= -1e-59) {
tmp = y * x;
} else if (y <= 0.00125) {
tmp = 1.0 - y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1e+52: tmp = x elif y <= -1.5e+23: tmp = 1.0 / y elif y <= -1.0: tmp = x elif y <= -6e-49: tmp = 1.0 - y elif y <= -1e-59: tmp = y * x elif y <= 0.00125: tmp = 1.0 - y else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1e+52) tmp = x; elseif (y <= -1.5e+23) tmp = Float64(1.0 / y); elseif (y <= -1.0) tmp = x; elseif (y <= -6e-49) tmp = Float64(1.0 - y); elseif (y <= -1e-59) tmp = Float64(y * x); elseif (y <= 0.00125) tmp = Float64(1.0 - y); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1e+52) tmp = x; elseif (y <= -1.5e+23) tmp = 1.0 / y; elseif (y <= -1.0) tmp = x; elseif (y <= -6e-49) tmp = 1.0 - y; elseif (y <= -1e-59) tmp = y * x; elseif (y <= 0.00125) tmp = 1.0 - y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1e+52], x, If[LessEqual[y, -1.5e+23], N[(1.0 / y), $MachinePrecision], If[LessEqual[y, -1.0], x, If[LessEqual[y, -6e-49], N[(1.0 - y), $MachinePrecision], If[LessEqual[y, -1e-59], N[(y * x), $MachinePrecision], If[LessEqual[y, 0.00125], N[(1.0 - y), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+52}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{+23}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-49}:\\
\;\;\;\;1 - y\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-59}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 0.00125:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -9.9999999999999999e51 or -1.5e23 < y < -1 or 0.00125000000000000003 < y Initial program 32.9%
associate-/l*54.9%
remove-double-neg54.9%
remove-double-neg54.9%
+-commutative54.9%
Simplified54.9%
Taylor expanded in y around inf 73.9%
if -9.9999999999999999e51 < y < -1.5e23Initial program 14.8%
associate-/l*24.9%
remove-double-neg24.9%
remove-double-neg24.9%
+-commutative24.9%
Simplified24.9%
Taylor expanded in y around inf 99.8%
associate--l+99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in x around 0 76.8%
if -1 < y < -6e-49 or -1e-59 < y < 0.00125000000000000003Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 72.4%
Taylor expanded in y around 0 71.2%
neg-mul-171.2%
unsub-neg71.2%
Simplified71.2%
if -6e-49 < y < -1e-59Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification73.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (/ 1.0 y))))
(if (<= y -1.0)
t_0
(if (<= y -3.8e-52)
(- 1.0 y)
(if (<= y -8.8e-60) (* y x) (if (<= y 0.00125) (- 1.0 y) t_0))))))
double code(double x, double y) {
double t_0 = x + (1.0 / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= -3.8e-52) {
tmp = 1.0 - y;
} else if (y <= -8.8e-60) {
tmp = y * x;
} else if (y <= 0.00125) {
tmp = 1.0 - y;
} 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 = x + (1.0d0 / y)
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= (-3.8d-52)) then
tmp = 1.0d0 - y
else if (y <= (-8.8d-60)) then
tmp = y * x
else if (y <= 0.00125d0) then
tmp = 1.0d0 - y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (1.0 / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= -3.8e-52) {
tmp = 1.0 - y;
} else if (y <= -8.8e-60) {
tmp = y * x;
} else if (y <= 0.00125) {
tmp = 1.0 - y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (1.0 / y) tmp = 0 if y <= -1.0: tmp = t_0 elif y <= -3.8e-52: tmp = 1.0 - y elif y <= -8.8e-60: tmp = y * x elif y <= 0.00125: tmp = 1.0 - y else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(1.0 / y)) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= -3.8e-52) tmp = Float64(1.0 - y); elseif (y <= -8.8e-60) tmp = Float64(y * x); elseif (y <= 0.00125) tmp = Float64(1.0 - y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + (1.0 / y); tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= -3.8e-52) tmp = 1.0 - y; elseif (y <= -8.8e-60) tmp = y * x; elseif (y <= 0.00125) tmp = 1.0 - y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, -3.8e-52], N[(1.0 - y), $MachinePrecision], If[LessEqual[y, -8.8e-60], N[(y * x), $MachinePrecision], If[LessEqual[y, 0.00125], N[(1.0 - y), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{1}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-52}:\\
\;\;\;\;1 - y\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-60}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 0.00125:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 0.00125000000000000003 < y Initial program 31.6%
associate-/l*52.9%
remove-double-neg52.9%
remove-double-neg52.9%
+-commutative52.9%
Simplified52.9%
Taylor expanded in y around inf 98.4%
Simplified98.4%
associate-+l-98.4%
div-sub98.4%
div-inv98.4%
cancel-sign-sub-inv98.4%
+-commutative98.4%
distribute-neg-in98.4%
metadata-eval98.4%
sub-neg98.4%
div-inv98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 97.7%
Taylor expanded in y around inf 97.5%
+-commutative97.5%
Simplified97.5%
if -1 < y < -3.8000000000000003e-52 or -8.7999999999999995e-60 < y < 0.00125000000000000003Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 72.4%
Taylor expanded in y around 0 71.2%
neg-mul-171.2%
unsub-neg71.2%
Simplified71.2%
if -3.8000000000000003e-52 < y < -8.7999999999999995e-60Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification85.4%
(FPCore (x y)
:precision binary64
(if (<= y -1.0)
x
(if (<= y -2.6e-53)
(- 1.0 y)
(if (<= y -7.2e-60) (* y x) (if (<= y 0.00125) (- 1.0 y) x)))))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= -2.6e-53) {
tmp = 1.0 - y;
} else if (y <= -7.2e-60) {
tmp = y * x;
} else if (y <= 0.00125) {
tmp = 1.0 - y;
} 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 (y <= (-1.0d0)) then
tmp = x
else if (y <= (-2.6d-53)) then
tmp = 1.0d0 - y
else if (y <= (-7.2d-60)) then
tmp = y * x
else if (y <= 0.00125d0) then
tmp = 1.0d0 - y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= -2.6e-53) {
tmp = 1.0 - y;
} else if (y <= -7.2e-60) {
tmp = y * x;
} else if (y <= 0.00125) {
tmp = 1.0 - y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= -2.6e-53: tmp = 1.0 - y elif y <= -7.2e-60: tmp = y * x elif y <= 0.00125: tmp = 1.0 - y else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= -2.6e-53) tmp = Float64(1.0 - y); elseif (y <= -7.2e-60) tmp = Float64(y * x); elseif (y <= 0.00125) tmp = Float64(1.0 - y); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.0) tmp = x; elseif (y <= -2.6e-53) tmp = 1.0 - y; elseif (y <= -7.2e-60) tmp = y * x; elseif (y <= 0.00125) tmp = 1.0 - y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, -2.6e-53], N[(1.0 - y), $MachinePrecision], If[LessEqual[y, -7.2e-60], N[(y * x), $MachinePrecision], If[LessEqual[y, 0.00125], N[(1.0 - y), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-53}:\\
\;\;\;\;1 - y\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{-60}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 0.00125:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 0.00125000000000000003 < y Initial program 31.6%
associate-/l*52.9%
remove-double-neg52.9%
remove-double-neg52.9%
+-commutative52.9%
Simplified52.9%
Taylor expanded in y around inf 70.7%
if -1 < y < -2.59999999999999996e-53 or -7.2e-60 < y < 0.00125000000000000003Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 72.4%
Taylor expanded in y around 0 71.2%
neg-mul-171.2%
unsub-neg71.2%
Simplified71.2%
if -2.59999999999999996e-53 < y < -7.2e-60Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification71.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (/ 1.0 y))))
(if (<= y -1.0)
t_0
(if (<= y 9e-72)
(- 1.0 y)
(if (<= y 33000000000000.0) (* y (/ x (+ y 1.0))) t_0)))))
double code(double x, double y) {
double t_0 = x + (1.0 / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 9e-72) {
tmp = 1.0 - y;
} else if (y <= 33000000000000.0) {
tmp = y * (x / (y + 1.0));
} 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 = x + (1.0d0 / y)
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= 9d-72) then
tmp = 1.0d0 - y
else if (y <= 33000000000000.0d0) then
tmp = y * (x / (y + 1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (1.0 / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 9e-72) {
tmp = 1.0 - y;
} else if (y <= 33000000000000.0) {
tmp = y * (x / (y + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (1.0 / y) tmp = 0 if y <= -1.0: tmp = t_0 elif y <= 9e-72: tmp = 1.0 - y elif y <= 33000000000000.0: tmp = y * (x / (y + 1.0)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(1.0 / y)) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 9e-72) tmp = Float64(1.0 - y); elseif (y <= 33000000000000.0) tmp = Float64(y * Float64(x / Float64(y + 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + (1.0 / y); tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= 9e-72) tmp = 1.0 - y; elseif (y <= 33000000000000.0) tmp = y * (x / (y + 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 9e-72], N[(1.0 - y), $MachinePrecision], If[LessEqual[y, 33000000000000.0], N[(y * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{1}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-72}:\\
\;\;\;\;1 - y\\
\mathbf{elif}\;y \leq 33000000000000:\\
\;\;\;\;y \cdot \frac{x}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 3.3e13 < y Initial program 29.5%
associate-/l*51.4%
remove-double-neg51.4%
remove-double-neg51.4%
+-commutative51.4%
Simplified51.4%
Taylor expanded in y around inf 99.8%
Simplified99.8%
associate-+l-99.8%
div-sub99.8%
div-inv99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
sub-neg99.8%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.5%
Taylor expanded in y around inf 99.3%
+-commutative99.3%
Simplified99.3%
if -1 < y < 9e-72Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 73.0%
Taylor expanded in y around 0 72.0%
neg-mul-172.0%
unsub-neg72.0%
Simplified72.0%
if 9e-72 < y < 3.3e13Initial program 99.9%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 65.8%
*-commutative65.8%
associate-/l*65.9%
Simplified65.9%
Final simplification85.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (/ (- 1.0 x) y))))
(if (<= y -1.0)
t_0
(if (<= y 9e-72)
(- 1.0 y)
(if (<= y 510000.0) (* y (/ x (+ y 1.0))) t_0)))))
double code(double x, double y) {
double t_0 = x + ((1.0 - x) / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 9e-72) {
tmp = 1.0 - y;
} else if (y <= 510000.0) {
tmp = y * (x / (y + 1.0));
} 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 = x + ((1.0d0 - x) / y)
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= 9d-72) then
tmp = 1.0d0 - y
else if (y <= 510000.0d0) then
tmp = y * (x / (y + 1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + ((1.0 - x) / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 9e-72) {
tmp = 1.0 - y;
} else if (y <= 510000.0) {
tmp = y * (x / (y + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x + ((1.0 - x) / y) tmp = 0 if y <= -1.0: tmp = t_0 elif y <= 9e-72: tmp = 1.0 - y elif y <= 510000.0: tmp = y * (x / (y + 1.0)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(Float64(1.0 - x) / y)) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 9e-72) tmp = Float64(1.0 - y); elseif (y <= 510000.0) tmp = Float64(y * Float64(x / Float64(y + 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + ((1.0 - x) / y); tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= 9e-72) tmp = 1.0 - y; elseif (y <= 510000.0) tmp = y * (x / (y + 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 9e-72], N[(1.0 - y), $MachinePrecision], If[LessEqual[y, 510000.0], N[(y * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{1 - x}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-72}:\\
\;\;\;\;1 - y\\
\mathbf{elif}\;y \leq 510000:\\
\;\;\;\;y \cdot \frac{x}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 5.1e5 < y Initial program 30.1%
associate-/l*51.8%
remove-double-neg51.8%
remove-double-neg51.8%
+-commutative51.8%
Simplified51.8%
Taylor expanded in y around inf 99.5%
associate--l+99.5%
div-sub99.5%
Simplified99.5%
if -1 < y < 9e-72Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 73.0%
Taylor expanded in y around 0 72.0%
neg-mul-172.0%
unsub-neg72.0%
Simplified72.0%
if 9e-72 < y < 5.1e5Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 64.1%
*-commutative64.1%
associate-/l*64.1%
Simplified64.1%
Final simplification85.4%
(FPCore (x y)
:precision binary64
(if (<= y -27000000.0)
(+ x (- (/ 1.0 y) (/ (/ 1.0 y) y)))
(if (<= y 255000000.0)
(+ 1.0 (* (- 1.0 x) (/ y (- -1.0 y))))
(+ x (/ (- 1.0 x) y)))))
double code(double x, double y) {
double tmp;
if (y <= -27000000.0) {
tmp = x + ((1.0 / y) - ((1.0 / y) / y));
} else if (y <= 255000000.0) {
tmp = 1.0 + ((1.0 - x) * (y / (-1.0 - y)));
} else {
tmp = x + ((1.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 <= (-27000000.0d0)) then
tmp = x + ((1.0d0 / y) - ((1.0d0 / y) / y))
else if (y <= 255000000.0d0) then
tmp = 1.0d0 + ((1.0d0 - x) * (y / ((-1.0d0) - y)))
else
tmp = x + ((1.0d0 - x) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -27000000.0) {
tmp = x + ((1.0 / y) - ((1.0 / y) / y));
} else if (y <= 255000000.0) {
tmp = 1.0 + ((1.0 - x) * (y / (-1.0 - y)));
} else {
tmp = x + ((1.0 - x) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -27000000.0: tmp = x + ((1.0 / y) - ((1.0 / y) / y)) elif y <= 255000000.0: tmp = 1.0 + ((1.0 - x) * (y / (-1.0 - y))) else: tmp = x + ((1.0 - x) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -27000000.0) tmp = Float64(x + Float64(Float64(1.0 / y) - Float64(Float64(1.0 / y) / y))); elseif (y <= 255000000.0) tmp = Float64(1.0 + Float64(Float64(1.0 - x) * Float64(y / Float64(-1.0 - y)))); else tmp = Float64(x + Float64(Float64(1.0 - x) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -27000000.0) tmp = x + ((1.0 / y) - ((1.0 / y) / y)); elseif (y <= 255000000.0) tmp = 1.0 + ((1.0 - x) * (y / (-1.0 - y))); else tmp = x + ((1.0 - x) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -27000000.0], N[(x + N[(N[(1.0 / y), $MachinePrecision] - N[(N[(1.0 / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 255000000.0], N[(1.0 + N[(N[(1.0 - x), $MachinePrecision] * N[(y / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -27000000:\\
\;\;\;\;x + \left(\frac{1}{y} - \frac{\frac{1}{y}}{y}\right)\\
\mathbf{elif}\;y \leq 255000000:\\
\;\;\;\;1 + \left(1 - x\right) \cdot \frac{y}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\end{array}
\end{array}
if y < -2.7e7Initial program 25.7%
associate-/l*52.7%
remove-double-neg52.7%
remove-double-neg52.7%
+-commutative52.7%
Simplified52.7%
Taylor expanded in y around inf 100.0%
Simplified99.9%
associate-+l-99.9%
div-sub100.0%
div-inv100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
sub-neg100.0%
div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
if -2.7e7 < y < 2.55e8Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
if 2.55e8 < y Initial program 33.5%
associate-/l*50.1%
remove-double-neg50.1%
remove-double-neg50.1%
+-commutative50.1%
Simplified50.1%
Taylor expanded in y around inf 100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 1.0))) (+ x (/ (- 1.0 x) y)) (+ 1.0 (* y (+ x -1.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.0)) {
tmp = x + ((1.0 - x) / y);
} else {
tmp = 1.0 + (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 <= (-1.0d0)) .or. (.not. (y <= 1.0d0))) then
tmp = x + ((1.0d0 - x) / y)
else
tmp = 1.0d0 + (y * (x + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.0)) {
tmp = x + ((1.0 - x) / y);
} else {
tmp = 1.0 + (y * (x + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.0) or not (y <= 1.0): tmp = x + ((1.0 - x) / y) else: tmp = 1.0 + (y * (x + -1.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.0) || !(y <= 1.0)) tmp = Float64(x + Float64(Float64(1.0 - x) / y)); else tmp = Float64(1.0 + Float64(y * Float64(x + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.0) || ~((y <= 1.0))) tmp = x + ((1.0 - x) / y); else tmp = 1.0 + (y * (x + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;x + \frac{1 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \left(x + -1\right)\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 30.6%
associate-/l*52.2%
remove-double-neg52.2%
remove-double-neg52.2%
+-commutative52.2%
Simplified52.2%
Taylor expanded in y around inf 99.2%
associate--l+99.2%
div-sub99.2%
Simplified99.2%
if -1 < y < 1Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 95.4%
Final simplification97.4%
(FPCore (x y) :precision binary64 (if (<= y -1.0) (+ x (/ (- 1.0 (/ 1.0 y)) y)) (if (<= y 1.0) (+ 1.0 (* y (+ x -1.0))) (+ x (/ (- 1.0 x) y)))))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x + ((1.0 - (1.0 / y)) / y);
} else if (y <= 1.0) {
tmp = 1.0 + (y * (x + -1.0));
} else {
tmp = x + ((1.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.0d0)) then
tmp = x + ((1.0d0 - (1.0d0 / y)) / y)
else if (y <= 1.0d0) then
tmp = 1.0d0 + (y * (x + (-1.0d0)))
else
tmp = x + ((1.0d0 - x) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x + ((1.0 - (1.0 / y)) / y);
} else if (y <= 1.0) {
tmp = 1.0 + (y * (x + -1.0));
} else {
tmp = x + ((1.0 - x) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x + ((1.0 - (1.0 / y)) / y) elif y <= 1.0: tmp = 1.0 + (y * (x + -1.0)) else: tmp = x + ((1.0 - x) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = Float64(x + Float64(Float64(1.0 - Float64(1.0 / y)) / y)); elseif (y <= 1.0) tmp = Float64(1.0 + Float64(y * Float64(x + -1.0))); else tmp = Float64(x + Float64(Float64(1.0 - x) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.0) tmp = x + ((1.0 - (1.0 / y)) / y); elseif (y <= 1.0) tmp = 1.0 + (y * (x + -1.0)); else tmp = x + ((1.0 - x) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], N[(x + N[(N[(1.0 - N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(1.0 + N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x + \frac{1 - \frac{1}{y}}{y}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;1 + y \cdot \left(x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\end{array}
\end{array}
if y < -1Initial program 26.8%
associate-/l*53.4%
remove-double-neg53.4%
remove-double-neg53.4%
+-commutative53.4%
Simplified53.4%
Taylor expanded in y around inf 99.6%
Simplified99.6%
Taylor expanded in x around 0 99.0%
if -1 < y < 1Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 95.4%
if 1 < y Initial program 34.5%
associate-/l*50.8%
remove-double-neg50.8%
remove-double-neg50.8%
+-commutative50.8%
Simplified50.8%
Taylor expanded in y around inf 99.5%
associate--l+99.5%
div-sub99.5%
Simplified99.5%
Final simplification97.4%
(FPCore (x y) :precision binary64 (if (<= y -1.0) (+ x (- (/ 1.0 y) (/ (/ 1.0 y) y))) (if (<= y 1.0) (+ 1.0 (* y (+ x -1.0))) (+ x (/ (- 1.0 x) y)))))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x + ((1.0 / y) - ((1.0 / y) / y));
} else if (y <= 1.0) {
tmp = 1.0 + (y * (x + -1.0));
} else {
tmp = x + ((1.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.0d0)) then
tmp = x + ((1.0d0 / y) - ((1.0d0 / y) / y))
else if (y <= 1.0d0) then
tmp = 1.0d0 + (y * (x + (-1.0d0)))
else
tmp = x + ((1.0d0 - x) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x + ((1.0 / y) - ((1.0 / y) / y));
} else if (y <= 1.0) {
tmp = 1.0 + (y * (x + -1.0));
} else {
tmp = x + ((1.0 - x) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x + ((1.0 / y) - ((1.0 / y) / y)) elif y <= 1.0: tmp = 1.0 + (y * (x + -1.0)) else: tmp = x + ((1.0 - x) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = Float64(x + Float64(Float64(1.0 / y) - Float64(Float64(1.0 / y) / y))); elseif (y <= 1.0) tmp = Float64(1.0 + Float64(y * Float64(x + -1.0))); else tmp = Float64(x + Float64(Float64(1.0 - x) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.0) tmp = x + ((1.0 / y) - ((1.0 / y) / y)); elseif (y <= 1.0) tmp = 1.0 + (y * (x + -1.0)); else tmp = x + ((1.0 - x) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], N[(x + N[(N[(1.0 / y), $MachinePrecision] - N[(N[(1.0 / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(1.0 + N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x + \left(\frac{1}{y} - \frac{\frac{1}{y}}{y}\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;1 + y \cdot \left(x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\end{array}
\end{array}
if y < -1Initial program 26.8%
associate-/l*53.4%
remove-double-neg53.4%
remove-double-neg53.4%
+-commutative53.4%
Simplified53.4%
Taylor expanded in y around inf 99.6%
Simplified99.6%
associate-+l-99.6%
div-sub99.6%
div-inv99.6%
cancel-sign-sub-inv99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
sub-neg99.6%
div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.0%
if -1 < y < 1Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 95.4%
if 1 < y Initial program 34.5%
associate-/l*50.8%
remove-double-neg50.8%
remove-double-neg50.8%
+-commutative50.8%
Simplified50.8%
Taylor expanded in y around inf 99.5%
associate--l+99.5%
div-sub99.5%
Simplified99.5%
Final simplification97.4%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 0.00125) 1.0 x)))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 0.00125) {
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 (y <= (-1.0d0)) then
tmp = x
else if (y <= 0.00125d0) then
tmp = 1.0d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 0.00125) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 0.00125: tmp = 1.0 else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 0.00125) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.0) tmp = x; elseif (y <= 0.00125) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 0.00125], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 0.00125:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 0.00125000000000000003 < y Initial program 31.6%
associate-/l*52.9%
remove-double-neg52.9%
remove-double-neg52.9%
+-commutative52.9%
Simplified52.9%
Taylor expanded in y around inf 70.7%
if -1 < y < 0.00125000000000000003Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 67.9%
Final simplification69.4%
(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 64.5%
associate-/l*75.5%
remove-double-neg75.5%
remove-double-neg75.5%
+-commutative75.5%
Simplified75.5%
Taylor expanded in y around 0 34.5%
Final simplification34.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (/ 1.0 y) (- (/ x y) x))))
(if (< y -3693.8482788297247)
t_0
(if (< y 6799310503.41891) (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))) t_0))))
double code(double x, double y) {
double t_0 = (1.0 / y) - ((x / y) - x);
double tmp;
if (y < -3693.8482788297247) {
tmp = t_0;
} else if (y < 6799310503.41891) {
tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0));
} 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 = (1.0d0 / y) - ((x / y) - x)
if (y < (-3693.8482788297247d0)) then
tmp = t_0
else if (y < 6799310503.41891d0) then
tmp = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (1.0 / y) - ((x / y) - x);
double tmp;
if (y < -3693.8482788297247) {
tmp = t_0;
} else if (y < 6799310503.41891) {
tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (1.0 / y) - ((x / y) - x) tmp = 0 if y < -3693.8482788297247: tmp = t_0 elif y < 6799310503.41891: tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(1.0 / y) - Float64(Float64(x / y) - x)) tmp = 0.0 if (y < -3693.8482788297247) tmp = t_0; elseif (y < 6799310503.41891) tmp = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (1.0 / y) - ((x / y) - x); tmp = 0.0; if (y < -3693.8482788297247) tmp = t_0; elseif (y < 6799310503.41891) tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(1.0 / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -3693.8482788297247], t$95$0, If[Less[y, 6799310503.41891], N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{y} - \left(\frac{x}{y} - x\right)\\
\mathbf{if}\;y < -3693.8482788297247:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y < 6799310503.41891:\\
\;\;\;\;1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
herbie shell --seed 2024096
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:alt
(if (< y -3693.8482788297247) (- (/ 1.0 y) (- (/ x y) x)) (if (< y 6799310503.41891) (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))) (- (/ 1.0 y) (- (/ x y) x))))
(- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))