
(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 -11500.0)
(+
(- x (- (/ -1.0 (pow y 3.0)) (/ 1.0 y)))
(+
(/ x (pow y 2.0))
(- (/ -1.0 (pow y 2.0)) (+ (/ x y) (/ x (pow y 3.0))))))
(if (<= y 180000000.0)
(+ 1.0 (/ (* y (- 1.0 x)) (- -1.0 y)))
(- x (/ (+ (/ 1.0 y) -1.0) y)))))
double code(double x, double y) {
double tmp;
if (y <= -11500.0) {
tmp = (x - ((-1.0 / pow(y, 3.0)) - (1.0 / y))) + ((x / pow(y, 2.0)) + ((-1.0 / pow(y, 2.0)) - ((x / y) + (x / pow(y, 3.0)))));
} else if (y <= 180000000.0) {
tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y));
} else {
tmp = x - (((1.0 / y) + -1.0) / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-11500.0d0)) then
tmp = (x - (((-1.0d0) / (y ** 3.0d0)) - (1.0d0 / y))) + ((x / (y ** 2.0d0)) + (((-1.0d0) / (y ** 2.0d0)) - ((x / y) + (x / (y ** 3.0d0)))))
else if (y <= 180000000.0d0) then
tmp = 1.0d0 + ((y * (1.0d0 - x)) / ((-1.0d0) - y))
else
tmp = x - (((1.0d0 / y) + (-1.0d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -11500.0) {
tmp = (x - ((-1.0 / Math.pow(y, 3.0)) - (1.0 / y))) + ((x / Math.pow(y, 2.0)) + ((-1.0 / Math.pow(y, 2.0)) - ((x / y) + (x / Math.pow(y, 3.0)))));
} else if (y <= 180000000.0) {
tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y));
} else {
tmp = x - (((1.0 / y) + -1.0) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -11500.0: tmp = (x - ((-1.0 / math.pow(y, 3.0)) - (1.0 / y))) + ((x / math.pow(y, 2.0)) + ((-1.0 / math.pow(y, 2.0)) - ((x / y) + (x / math.pow(y, 3.0))))) elif y <= 180000000.0: tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y)) else: tmp = x - (((1.0 / y) + -1.0) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -11500.0) tmp = Float64(Float64(x - Float64(Float64(-1.0 / (y ^ 3.0)) - Float64(1.0 / y))) + Float64(Float64(x / (y ^ 2.0)) + Float64(Float64(-1.0 / (y ^ 2.0)) - Float64(Float64(x / y) + Float64(x / (y ^ 3.0)))))); elseif (y <= 180000000.0) tmp = Float64(1.0 + Float64(Float64(y * Float64(1.0 - x)) / Float64(-1.0 - y))); else tmp = Float64(x - Float64(Float64(Float64(1.0 / y) + -1.0) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -11500.0) tmp = (x - ((-1.0 / (y ^ 3.0)) - (1.0 / y))) + ((x / (y ^ 2.0)) + ((-1.0 / (y ^ 2.0)) - ((x / y) + (x / (y ^ 3.0))))); elseif (y <= 180000000.0) tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y)); else tmp = x - (((1.0 / y) + -1.0) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -11500.0], N[(N[(x - N[(N[(-1.0 / N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision] - N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x / N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] + N[(x / N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 180000000.0], N[(1.0 + N[(N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(1.0 / y), $MachinePrecision] + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -11500:\\
\;\;\;\;\left(x - \left(\frac{-1}{{y}^{3}} - \frac{1}{y}\right)\right) + \left(\frac{x}{{y}^{2}} + \left(\frac{-1}{{y}^{2}} - \left(\frac{x}{y} + \frac{x}{{y}^{3}}\right)\right)\right)\\
\mathbf{elif}\;y \leq 180000000:\\
\;\;\;\;1 + \frac{y \cdot \left(1 - x\right)}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\frac{1}{y} + -1}{y}\\
\end{array}
\end{array}
if y < -11500Initial program 34.9%
associate-/l*53.2%
remove-double-neg53.2%
remove-double-neg53.2%
+-commutative53.2%
Simplified53.2%
Taylor expanded in y around inf 100.0%
if -11500 < y < 1.8e8Initial program 100.0%
if 1.8e8 < y Initial program 27.6%
associate-/l*46.2%
remove-double-neg46.2%
remove-double-neg46.2%
+-commutative46.2%
Simplified46.2%
Taylor expanded in y around -inf 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* y (- 1.0 x)) (+ y 1.0))))
(if (or (<= t_0 2e-8) (not (<= t_0 5.0)))
(+ 1.0 (* (+ x -1.0) (/ y (+ y 1.0))))
(- x (/ (+ (/ 1.0 y) -1.0) y)))))
double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (y + 1.0);
double tmp;
if ((t_0 <= 2e-8) || !(t_0 <= 5.0)) {
tmp = 1.0 + ((x + -1.0) * (y / (y + 1.0)));
} else {
tmp = x - (((1.0 / y) + -1.0) / 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 * (1.0d0 - x)) / (y + 1.0d0)
if ((t_0 <= 2d-8) .or. (.not. (t_0 <= 5.0d0))) then
tmp = 1.0d0 + ((x + (-1.0d0)) * (y / (y + 1.0d0)))
else
tmp = x - (((1.0d0 / y) + (-1.0d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (y + 1.0);
double tmp;
if ((t_0 <= 2e-8) || !(t_0 <= 5.0)) {
tmp = 1.0 + ((x + -1.0) * (y / (y + 1.0)));
} else {
tmp = x - (((1.0 / y) + -1.0) / y);
}
return tmp;
}
def code(x, y): t_0 = (y * (1.0 - x)) / (y + 1.0) tmp = 0 if (t_0 <= 2e-8) or not (t_0 <= 5.0): tmp = 1.0 + ((x + -1.0) * (y / (y + 1.0))) else: tmp = x - (((1.0 / y) + -1.0) / y) return tmp
function code(x, y) t_0 = Float64(Float64(y * Float64(1.0 - x)) / Float64(y + 1.0)) tmp = 0.0 if ((t_0 <= 2e-8) || !(t_0 <= 5.0)) tmp = Float64(1.0 + Float64(Float64(x + -1.0) * Float64(y / Float64(y + 1.0)))); else tmp = Float64(x - Float64(Float64(Float64(1.0 / y) + -1.0) / y)); end return tmp end
function tmp_2 = code(x, y) t_0 = (y * (1.0 - x)) / (y + 1.0); tmp = 0.0; if ((t_0 <= 2e-8) || ~((t_0 <= 5.0))) tmp = 1.0 + ((x + -1.0) * (y / (y + 1.0))); else tmp = x - (((1.0 / y) + -1.0) / y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-8], N[Not[LessEqual[t$95$0, 5.0]], $MachinePrecision]], N[(1.0 + N[(N[(x + -1.0), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(1.0 / y), $MachinePrecision] + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y \cdot \left(1 - x\right)}{y + 1}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-8} \lor \neg \left(t\_0 \leq 5\right):\\
\;\;\;\;1 + \left(x + -1\right) \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\frac{1}{y} + -1}{y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 2e-8 or 5 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 87.2%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
if 2e-8 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 5Initial program 9.1%
associate-/l*9.1%
remove-double-neg9.1%
remove-double-neg9.1%
+-commutative9.1%
Simplified9.1%
Taylor expanded in y around -inf 99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(if (<= y -11500.0)
(- x (/ (- (+ x -1.0) (/ (- (+ x -1.0) (/ (+ x -1.0) y)) y)) y))
(if (<= y 62000000.0)
(+ 1.0 (/ (* y (- 1.0 x)) (- -1.0 y)))
(- x (/ (+ (/ 1.0 y) -1.0) y)))))
double code(double x, double y) {
double tmp;
if (y <= -11500.0) {
tmp = x - (((x + -1.0) - (((x + -1.0) - ((x + -1.0) / y)) / y)) / y);
} else if (y <= 62000000.0) {
tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y));
} else {
tmp = x - (((1.0 / y) + -1.0) / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-11500.0d0)) then
tmp = x - (((x + (-1.0d0)) - (((x + (-1.0d0)) - ((x + (-1.0d0)) / y)) / y)) / y)
else if (y <= 62000000.0d0) then
tmp = 1.0d0 + ((y * (1.0d0 - x)) / ((-1.0d0) - y))
else
tmp = x - (((1.0d0 / y) + (-1.0d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -11500.0) {
tmp = x - (((x + -1.0) - (((x + -1.0) - ((x + -1.0) / y)) / y)) / y);
} else if (y <= 62000000.0) {
tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y));
} else {
tmp = x - (((1.0 / y) + -1.0) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -11500.0: tmp = x - (((x + -1.0) - (((x + -1.0) - ((x + -1.0) / y)) / y)) / y) elif y <= 62000000.0: tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y)) else: tmp = x - (((1.0 / y) + -1.0) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -11500.0) tmp = Float64(x - Float64(Float64(Float64(x + -1.0) - Float64(Float64(Float64(x + -1.0) - Float64(Float64(x + -1.0) / y)) / y)) / y)); elseif (y <= 62000000.0) tmp = Float64(1.0 + Float64(Float64(y * Float64(1.0 - x)) / Float64(-1.0 - y))); else tmp = Float64(x - Float64(Float64(Float64(1.0 / y) + -1.0) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -11500.0) tmp = x - (((x + -1.0) - (((x + -1.0) - ((x + -1.0) / y)) / y)) / y); elseif (y <= 62000000.0) tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y)); else tmp = x - (((1.0 / y) + -1.0) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -11500.0], N[(x - N[(N[(N[(x + -1.0), $MachinePrecision] - N[(N[(N[(x + -1.0), $MachinePrecision] - N[(N[(x + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 62000000.0], N[(1.0 + N[(N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(1.0 / y), $MachinePrecision] + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -11500:\\
\;\;\;\;x - \frac{\left(x + -1\right) - \frac{\left(x + -1\right) - \frac{x + -1}{y}}{y}}{y}\\
\mathbf{elif}\;y \leq 62000000:\\
\;\;\;\;1 + \frac{y \cdot \left(1 - x\right)}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\frac{1}{y} + -1}{y}\\
\end{array}
\end{array}
if y < -11500Initial program 34.9%
associate-/l*53.2%
remove-double-neg53.2%
remove-double-neg53.2%
+-commutative53.2%
Simplified53.2%
Taylor expanded in y around -inf 99.9%
Simplified99.9%
if -11500 < y < 6.2e7Initial program 100.0%
if 6.2e7 < y Initial program 27.6%
associate-/l*46.2%
remove-double-neg46.2%
remove-double-neg46.2%
+-commutative46.2%
Simplified46.2%
Taylor expanded in y around -inf 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(if (<= y -1.0)
x
(if (<= y 2.75e-67)
1.0
(if (<= y 10.5) (* y x) (if (<= y 2.55e+70) (/ 1.0 y) x)))))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 2.75e-67) {
tmp = 1.0;
} else if (y <= 10.5) {
tmp = y * x;
} else if (y <= 2.55e+70) {
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.75d-67) then
tmp = 1.0d0
else if (y <= 10.5d0) then
tmp = y * x
else if (y <= 2.55d+70) 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.75e-67) {
tmp = 1.0;
} else if (y <= 10.5) {
tmp = y * x;
} else if (y <= 2.55e+70) {
tmp = 1.0 / y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 2.75e-67: tmp = 1.0 elif y <= 10.5: tmp = y * x elif y <= 2.55e+70: 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.75e-67) tmp = 1.0; elseif (y <= 10.5) tmp = Float64(y * x); elseif (y <= 2.55e+70) 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.75e-67) tmp = 1.0; elseif (y <= 10.5) tmp = y * x; elseif (y <= 2.55e+70) 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.75e-67], 1.0, If[LessEqual[y, 10.5], N[(y * x), $MachinePrecision], If[LessEqual[y, 2.55e+70], N[(1.0 / y), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{-67}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 10.5:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{+70}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 2.55000000000000007e70 < y Initial program 32.2%
associate-/l*52.9%
remove-double-neg52.9%
remove-double-neg52.9%
+-commutative52.9%
Simplified52.9%
Taylor expanded in y around inf 76.9%
if -1 < y < 2.7500000000000001e-67Initial 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 99.9%
Taylor expanded in y around 0 82.4%
if 2.7500000000000001e-67 < y < 10.5Initial 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 100.0%
Taylor expanded in x around inf 63.0%
*-commutative63.0%
Simplified63.0%
if 10.5 < y < 2.55000000000000007e70Initial program 22.6%
associate-/l*22.7%
remove-double-neg22.7%
remove-double-neg22.7%
+-commutative22.7%
Simplified22.7%
Taylor expanded in y around -inf 97.2%
mul-1-neg97.2%
distribute-frac-neg97.2%
neg-sub097.2%
associate-+l-97.2%
neg-sub097.2%
+-commutative97.2%
sub-neg97.2%
Simplified97.2%
Taylor expanded in x around 0 83.7%
(FPCore (x y)
:precision binary64
(if (<= y -260000.0)
(- x (/ (- (+ x -1.0) (/ (+ x -1.0) y)) y))
(if (<= y 26500000.0)
(+ 1.0 (/ (* y (- 1.0 x)) (- -1.0 y)))
(- x (/ (+ (/ 1.0 y) -1.0) y)))))
double code(double x, double y) {
double tmp;
if (y <= -260000.0) {
tmp = x - (((x + -1.0) - ((x + -1.0) / y)) / y);
} else if (y <= 26500000.0) {
tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y));
} else {
tmp = x - (((1.0 / y) + -1.0) / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-260000.0d0)) then
tmp = x - (((x + (-1.0d0)) - ((x + (-1.0d0)) / y)) / y)
else if (y <= 26500000.0d0) then
tmp = 1.0d0 + ((y * (1.0d0 - x)) / ((-1.0d0) - y))
else
tmp = x - (((1.0d0 / y) + (-1.0d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -260000.0) {
tmp = x - (((x + -1.0) - ((x + -1.0) / y)) / y);
} else if (y <= 26500000.0) {
tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y));
} else {
tmp = x - (((1.0 / y) + -1.0) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -260000.0: tmp = x - (((x + -1.0) - ((x + -1.0) / y)) / y) elif y <= 26500000.0: tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y)) else: tmp = x - (((1.0 / y) + -1.0) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -260000.0) tmp = Float64(x - Float64(Float64(Float64(x + -1.0) - Float64(Float64(x + -1.0) / y)) / y)); elseif (y <= 26500000.0) tmp = Float64(1.0 + Float64(Float64(y * Float64(1.0 - x)) / Float64(-1.0 - y))); else tmp = Float64(x - Float64(Float64(Float64(1.0 / y) + -1.0) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -260000.0) tmp = x - (((x + -1.0) - ((x + -1.0) / y)) / y); elseif (y <= 26500000.0) tmp = 1.0 + ((y * (1.0 - x)) / (-1.0 - y)); else tmp = x - (((1.0 / y) + -1.0) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -260000.0], N[(x - N[(N[(N[(x + -1.0), $MachinePrecision] - N[(N[(x + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 26500000.0], N[(1.0 + N[(N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(1.0 / y), $MachinePrecision] + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -260000:\\
\;\;\;\;x - \frac{\left(x + -1\right) - \frac{x + -1}{y}}{y}\\
\mathbf{elif}\;y \leq 26500000:\\
\;\;\;\;1 + \frac{y \cdot \left(1 - x\right)}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\frac{1}{y} + -1}{y}\\
\end{array}
\end{array}
if y < -2.6e5Initial program 34.9%
associate-/l*53.2%
remove-double-neg53.2%
remove-double-neg53.2%
+-commutative53.2%
Simplified53.2%
Taylor expanded in y around -inf 99.5%
Simplified99.5%
if -2.6e5 < y < 2.65e7Initial program 100.0%
if 2.65e7 < y Initial program 27.6%
associate-/l*46.2%
remove-double-neg46.2%
remove-double-neg46.2%
+-commutative46.2%
Simplified46.2%
Taylor expanded in y around -inf 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification99.9%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ x (/ 1.0 y)))) (if (<= y -1.0) t_0 (if (<= y 8.5e-70) 1.0 (if (<= y 0.039) (* y x) 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 <= 8.5e-70) {
tmp = 1.0;
} else if (y <= 0.039) {
tmp = y * x;
} 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 <= 8.5d-70) then
tmp = 1.0d0
else if (y <= 0.039d0) then
tmp = y * x
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 <= 8.5e-70) {
tmp = 1.0;
} else if (y <= 0.039) {
tmp = y * x;
} 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 <= 8.5e-70: tmp = 1.0 elif y <= 0.039: tmp = y * x 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 <= 8.5e-70) tmp = 1.0; elseif (y <= 0.039) tmp = Float64(y * x); 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 <= 8.5e-70) tmp = 1.0; elseif (y <= 0.039) tmp = y * x; 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, 8.5e-70], 1.0, If[LessEqual[y, 0.039], N[(y * x), $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 8.5 \cdot 10^{-70}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 0.039:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 0.0389999999999999999 < y Initial program 31.2%
associate-/l*49.6%
remove-double-neg49.6%
remove-double-neg49.6%
+-commutative49.6%
Simplified49.6%
Taylor expanded in y around -inf 98.8%
mul-1-neg98.8%
distribute-frac-neg98.8%
neg-sub098.8%
associate-+l-98.8%
neg-sub098.8%
+-commutative98.8%
sub-neg98.8%
Simplified98.8%
Taylor expanded in x around 0 98.6%
if -1 < y < 8.5000000000000002e-70Initial 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 99.9%
Taylor expanded in y around 0 82.4%
if 8.5000000000000002e-70 < y < 0.0389999999999999999Initial 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 100.0%
Taylor expanded in x around inf 63.0%
*-commutative63.0%
Simplified63.0%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 1.2))) (- x (/ (+ (/ 1.0 y) -1.0) y)) (+ 1.0 (* y x))))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.2)) {
tmp = x - (((1.0 / y) + -1.0) / y);
} else {
tmp = 1.0 + (y * 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)) .or. (.not. (y <= 1.2d0))) then
tmp = x - (((1.0d0 / y) + (-1.0d0)) / y)
else
tmp = 1.0d0 + (y * x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.2)) {
tmp = x - (((1.0 / y) + -1.0) / y);
} else {
tmp = 1.0 + (y * x);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.0) or not (y <= 1.2): tmp = x - (((1.0 / y) + -1.0) / y) else: tmp = 1.0 + (y * x) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.0) || !(y <= 1.2)) tmp = Float64(x - Float64(Float64(Float64(1.0 / y) + -1.0) / y)); else tmp = Float64(1.0 + Float64(y * x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.0) || ~((y <= 1.2))) tmp = x - (((1.0 / y) + -1.0) / y); else tmp = 1.0 + (y * x); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 1.2]], $MachinePrecision]], N[(x - N[(N[(N[(1.0 / y), $MachinePrecision] + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1.2\right):\\
\;\;\;\;x - \frac{\frac{1}{y} + -1}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot x\\
\end{array}
\end{array}
if y < -1 or 1.19999999999999996 < y Initial program 31.2%
associate-/l*49.6%
remove-double-neg49.6%
remove-double-neg49.6%
+-commutative49.6%
Simplified49.6%
Taylor expanded in y around -inf 99.8%
Simplified99.8%
Taylor expanded in x around 0 99.6%
if -1 < y < 1.19999999999999996Initial 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 99.9%
Taylor expanded in x around inf 99.9%
neg-mul-199.9%
Simplified99.9%
cancel-sign-sub99.9%
+-commutative99.9%
Applied egg-rr99.9%
Final simplification99.8%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 9.6e-71) 1.0 (if (<= y 120000000000.0) (* y x) x))))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 9.6e-71) {
tmp = 1.0;
} else if (y <= 120000000000.0) {
tmp = y * x;
} 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 <= 9.6d-71) then
tmp = 1.0d0
else if (y <= 120000000000.0d0) then
tmp = y * x
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 <= 9.6e-71) {
tmp = 1.0;
} else if (y <= 120000000000.0) {
tmp = y * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 9.6e-71: tmp = 1.0 elif y <= 120000000000.0: tmp = y * x else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 9.6e-71) tmp = 1.0; elseif (y <= 120000000000.0) tmp = Float64(y * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.0) tmp = x; elseif (y <= 9.6e-71) tmp = 1.0; elseif (y <= 120000000000.0) tmp = y * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 9.6e-71], 1.0, If[LessEqual[y, 120000000000.0], N[(y * x), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-71}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 120000000000:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 1.2e11 < y Initial program 31.0%
associate-/l*49.6%
remove-double-neg49.6%
remove-double-neg49.6%
+-commutative49.6%
Simplified49.6%
Taylor expanded in y around inf 71.1%
if -1 < y < 9.6e-71Initial 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 99.9%
Taylor expanded in y around 0 82.4%
if 9.6e-71 < y < 1.2e11Initial program 97.4%
associate-/l*97.4%
remove-double-neg97.4%
remove-double-neg97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in y around 0 95.1%
Taylor expanded in x around inf 60.1%
*-commutative60.1%
Simplified60.1%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 1.3))) (+ x (/ (- 1.0 x) y)) (+ 1.0 (* y x))))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.3)) {
tmp = x + ((1.0 - x) / y);
} else {
tmp = 1.0 + (y * 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)) .or. (.not. (y <= 1.3d0))) then
tmp = x + ((1.0d0 - x) / y)
else
tmp = 1.0d0 + (y * x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.3)) {
tmp = x + ((1.0 - x) / y);
} else {
tmp = 1.0 + (y * x);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.0) or not (y <= 1.3): tmp = x + ((1.0 - x) / y) else: tmp = 1.0 + (y * x) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.0) || !(y <= 1.3)) tmp = Float64(x + Float64(Float64(1.0 - x) / y)); else tmp = Float64(1.0 + Float64(y * x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.0) || ~((y <= 1.3))) tmp = x + ((1.0 - x) / y); else tmp = 1.0 + (y * x); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 1.3]], $MachinePrecision]], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1.3\right):\\
\;\;\;\;x + \frac{1 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot x\\
\end{array}
\end{array}
if y < -1 or 1.30000000000000004 < y Initial program 31.2%
associate-/l*49.6%
remove-double-neg49.6%
remove-double-neg49.6%
+-commutative49.6%
Simplified49.6%
Taylor expanded in y around -inf 98.8%
mul-1-neg98.8%
distribute-frac-neg98.8%
neg-sub098.8%
associate-+l-98.8%
neg-sub098.8%
+-commutative98.8%
sub-neg98.8%
Simplified98.8%
if -1 < y < 1.30000000000000004Initial 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 99.9%
Taylor expanded in x around inf 99.9%
neg-mul-199.9%
Simplified99.9%
cancel-sign-sub99.9%
+-commutative99.9%
Applied egg-rr99.9%
Final simplification99.4%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 1.0))) (+ x (/ 1.0 y)) (+ 1.0 (* y x))))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.0)) {
tmp = x + (1.0 / y);
} else {
tmp = 1.0 + (y * 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)) .or. (.not. (y <= 1.0d0))) then
tmp = x + (1.0d0 / y)
else
tmp = 1.0d0 + (y * x)
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 / y);
} else {
tmp = 1.0 + (y * x);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.0) or not (y <= 1.0): tmp = x + (1.0 / y) else: tmp = 1.0 + (y * x) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.0) || !(y <= 1.0)) tmp = Float64(x + Float64(1.0 / y)); else tmp = Float64(1.0 + Float64(y * x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.0) || ~((y <= 1.0))) tmp = x + (1.0 / y); else tmp = 1.0 + (y * x); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;x + \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot x\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 31.2%
associate-/l*49.6%
remove-double-neg49.6%
remove-double-neg49.6%
+-commutative49.6%
Simplified49.6%
Taylor expanded in y around -inf 98.8%
mul-1-neg98.8%
distribute-frac-neg98.8%
neg-sub098.8%
associate-+l-98.8%
neg-sub098.8%
+-commutative98.8%
sub-neg98.8%
Simplified98.8%
Taylor expanded in x around 0 98.6%
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 99.9%
Taylor expanded in x around inf 99.9%
neg-mul-199.9%
Simplified99.9%
cancel-sign-sub99.9%
+-commutative99.9%
Applied egg-rr99.9%
Final simplification99.3%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 6600000000000.0) 1.0 x)))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 6600000000000.0) {
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 <= 6600000000000.0d0) 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 <= 6600000000000.0) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 6600000000000.0: tmp = 1.0 else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 6600000000000.0) 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 <= 6600000000000.0) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 6600000000000.0], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6600000000000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 6.6e12 < y Initial program 31.0%
associate-/l*49.7%
remove-double-neg49.7%
remove-double-neg49.7%
+-commutative49.7%
Simplified49.7%
Taylor expanded in y around inf 71.6%
if -1 < y < 6.6e12Initial program 99.1%
associate-/l*99.1%
remove-double-neg99.1%
remove-double-neg99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in y around 0 98.4%
Taylor expanded in y around 0 74.9%
(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 65.6%
associate-/l*74.8%
remove-double-neg74.8%
remove-double-neg74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in y around 0 51.2%
Taylor expanded in y around 0 40.0%
(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 2024157
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:alt
(! :herbie-platform default (if (< y -36938482788297247/10000000000000) (- (/ 1 y) (- (/ x y) x)) (if (< y 679931050341891/100000) (- 1 (/ (* (- 1 x) y) (+ y 1))) (- (/ 1 y) (- (/ x y) x)))))
(- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))