
(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 16 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 -350.0)
(*
x
(+
(/ (/ (+ 1.0 (/ (+ -1.0 (/ (- (/ -1.0 y) -1.0) y)) y)) y) x)
(/ y (+ y 1.0))))
(if (<= y 160000000.0)
(fma y (/ (+ x -1.0) (+ y 1.0)) 1.0)
(+ x (/ (- 1.0 x) y)))))
double code(double x, double y) {
double tmp;
if (y <= -350.0) {
tmp = x * ((((1.0 + ((-1.0 + (((-1.0 / y) - -1.0) / y)) / y)) / y) / x) + (y / (y + 1.0)));
} else if (y <= 160000000.0) {
tmp = fma(y, ((x + -1.0) / (y + 1.0)), 1.0);
} else {
tmp = x + ((1.0 - x) / y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= -350.0) tmp = Float64(x * Float64(Float64(Float64(Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(Float64(-1.0 / y) - -1.0) / y)) / y)) / y) / x) + Float64(y / Float64(y + 1.0)))); elseif (y <= 160000000.0) tmp = fma(y, Float64(Float64(x + -1.0) / Float64(y + 1.0)), 1.0); else tmp = Float64(x + Float64(Float64(1.0 - x) / y)); end return tmp end
code[x_, y_] := If[LessEqual[y, -350.0], N[(x * N[(N[(N[(N[(1.0 + N[(N[(-1.0 + N[(N[(N[(-1.0 / y), $MachinePrecision] - -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / x), $MachinePrecision] + N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 160000000.0], N[(y * N[(N[(x + -1.0), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -350:\\
\;\;\;\;x \cdot \left(\frac{\frac{1 + \frac{-1 + \frac{\frac{-1}{y} - -1}{y}}{y}}{y}}{x} + \frac{y}{y + 1}\right)\\
\mathbf{elif}\;y \leq 160000000:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x + -1}{y + 1}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\end{array}
\end{array}
if y < -350Initial program 35.8%
sub-neg35.8%
+-commutative35.8%
*-commutative35.8%
associate-/l*61.0%
distribute-rgt-neg-in61.0%
fma-define61.1%
distribute-frac-neg261.1%
+-commutative61.1%
distribute-neg-in61.1%
metadata-eval61.1%
unsub-neg61.1%
Simplified61.1%
Taylor expanded in x around -inf 77.2%
associate-*r*77.2%
neg-mul-177.2%
distribute-lft-out77.2%
associate-*r*77.2%
distribute-lft-neg-in77.2%
*-commutative77.2%
neg-mul-177.2%
remove-double-neg77.2%
+-commutative77.2%
mul-1-neg77.2%
sub-neg77.2%
sub-neg77.2%
distribute-frac-neg277.2%
distribute-neg-in77.2%
metadata-eval77.2%
sub-neg77.2%
Simplified77.2%
Taylor expanded in y around -inf 99.9%
if -350 < y < 1.6e8Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
associate-/l*99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
distribute-frac-neg299.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
if 1.6e8 < y Initial program 37.2%
associate-/l*62.4%
+-commutative62.4%
Simplified62.4%
Taylor expanded in y around inf 100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* y (- 1.0 x)) (+ y 1.0))))
(if (or (<= t_0 0.98) (not (<= t_0 2.0)))
(- 1.0 (* (- 1.0 x) (/ y (+ y 1.0))))
(+ x (/ (+ (/ (+ -1.0 (/ 1.0 y)) y) (- 1.0 x)) y)))))
double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (y + 1.0);
double tmp;
if ((t_0 <= 0.98) || !(t_0 <= 2.0)) {
tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0)));
} else {
tmp = x + ((((-1.0 + (1.0 / y)) / y) + (1.0 - x)) / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (y * (1.0d0 - x)) / (y + 1.0d0)
if ((t_0 <= 0.98d0) .or. (.not. (t_0 <= 2.0d0))) then
tmp = 1.0d0 - ((1.0d0 - x) * (y / (y + 1.0d0)))
else
tmp = x + (((((-1.0d0) + (1.0d0 / y)) / y) + (1.0d0 - x)) / 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 <= 0.98) || !(t_0 <= 2.0)) {
tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0)));
} else {
tmp = x + ((((-1.0 + (1.0 / y)) / y) + (1.0 - x)) / y);
}
return tmp;
}
def code(x, y): t_0 = (y * (1.0 - x)) / (y + 1.0) tmp = 0 if (t_0 <= 0.98) or not (t_0 <= 2.0): tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0))) else: tmp = x + ((((-1.0 + (1.0 / y)) / y) + (1.0 - x)) / 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 <= 0.98) || !(t_0 <= 2.0)) tmp = Float64(1.0 - Float64(Float64(1.0 - x) * Float64(y / Float64(y + 1.0)))); else tmp = Float64(x + Float64(Float64(Float64(Float64(-1.0 + Float64(1.0 / y)) / y) + Float64(1.0 - x)) / 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 <= 0.98) || ~((t_0 <= 2.0))) tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0))); else tmp = x + ((((-1.0 + (1.0 / y)) / y) + (1.0 - x)) / 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, 0.98], N[Not[LessEqual[t$95$0, 2.0]], $MachinePrecision]], N[(1.0 - N[(N[(1.0 - x), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(N[(-1.0 + N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $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 0.98 \lor \neg \left(t\_0 \leq 2\right):\\
\;\;\;\;1 - \left(1 - x\right) \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{-1 + \frac{1}{y}}{y} + \left(1 - x\right)}{y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 0.97999999999999998 or 2 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 84.5%
associate-/l*99.9%
+-commutative99.9%
Simplified99.9%
if 0.97999999999999998 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 2Initial program 10.7%
associate-/l*10.7%
+-commutative10.7%
Simplified10.7%
Taylor expanded in y around -inf 99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* y (- 1.0 x)) (+ y 1.0))))
(if (or (<= t_0 0.98) (not (<= t_0 1.00001)))
(- 1.0 (* (- 1.0 x) (/ y (+ y 1.0))))
(- x (/ (+ -1.0 (/ 1.0 y)) y)))))
double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (y + 1.0);
double tmp;
if ((t_0 <= 0.98) || !(t_0 <= 1.00001)) {
tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0)));
} else {
tmp = x - ((-1.0 + (1.0 / y)) / 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 <= 0.98d0) .or. (.not. (t_0 <= 1.00001d0))) then
tmp = 1.0d0 - ((1.0d0 - x) * (y / (y + 1.0d0)))
else
tmp = x - (((-1.0d0) + (1.0d0 / y)) / 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 <= 0.98) || !(t_0 <= 1.00001)) {
tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0)));
} else {
tmp = x - ((-1.0 + (1.0 / y)) / y);
}
return tmp;
}
def code(x, y): t_0 = (y * (1.0 - x)) / (y + 1.0) tmp = 0 if (t_0 <= 0.98) or not (t_0 <= 1.00001): tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0))) else: tmp = x - ((-1.0 + (1.0 / y)) / 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 <= 0.98) || !(t_0 <= 1.00001)) tmp = Float64(1.0 - Float64(Float64(1.0 - x) * Float64(y / Float64(y + 1.0)))); else tmp = Float64(x - Float64(Float64(-1.0 + Float64(1.0 / y)) / 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 <= 0.98) || ~((t_0 <= 1.00001))) tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0))); else tmp = x - ((-1.0 + (1.0 / y)) / 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, 0.98], N[Not[LessEqual[t$95$0, 1.00001]], $MachinePrecision]], N[(1.0 - N[(N[(1.0 - x), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(-1.0 + N[(1.0 / y), $MachinePrecision]), $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 0.98 \lor \neg \left(t\_0 \leq 1.00001\right):\\
\;\;\;\;1 - \left(1 - x\right) \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{-1 + \frac{1}{y}}{y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 0.97999999999999998 or 1.0000100000000001 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 84.5%
associate-/l*99.8%
+-commutative99.8%
Simplified99.8%
if 0.97999999999999998 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 1.0000100000000001Initial program 7.7%
associate-/l*7.7%
+-commutative7.7%
Simplified7.7%
Taylor expanded in y around -inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y 1.0))))
(if (<= y -1950.0)
(* x (+ (/ (/ (+ 1.0 (/ (+ -1.0 (/ (- (/ -1.0 y) -1.0) y)) y)) y) x) t_0))
(if (<= y 8.5e+15) (- 1.0 (* (- 1.0 x) t_0)) (+ x (/ 1.0 y))))))
double code(double x, double y) {
double t_0 = y / (y + 1.0);
double tmp;
if (y <= -1950.0) {
tmp = x * ((((1.0 + ((-1.0 + (((-1.0 / y) - -1.0) / y)) / y)) / y) / x) + t_0);
} else if (y <= 8.5e+15) {
tmp = 1.0 - ((1.0 - x) * t_0);
} else {
tmp = x + (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 / (y + 1.0d0)
if (y <= (-1950.0d0)) then
tmp = x * ((((1.0d0 + (((-1.0d0) + ((((-1.0d0) / y) - (-1.0d0)) / y)) / y)) / y) / x) + t_0)
else if (y <= 8.5d+15) then
tmp = 1.0d0 - ((1.0d0 - x) * t_0)
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (y + 1.0);
double tmp;
if (y <= -1950.0) {
tmp = x * ((((1.0 + ((-1.0 + (((-1.0 / y) - -1.0) / y)) / y)) / y) / x) + t_0);
} else if (y <= 8.5e+15) {
tmp = 1.0 - ((1.0 - x) * t_0);
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y): t_0 = y / (y + 1.0) tmp = 0 if y <= -1950.0: tmp = x * ((((1.0 + ((-1.0 + (((-1.0 / y) - -1.0) / y)) / y)) / y) / x) + t_0) elif y <= 8.5e+15: tmp = 1.0 - ((1.0 - x) * t_0) else: tmp = x + (1.0 / y) return tmp
function code(x, y) t_0 = Float64(y / Float64(y + 1.0)) tmp = 0.0 if (y <= -1950.0) tmp = Float64(x * Float64(Float64(Float64(Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(Float64(-1.0 / y) - -1.0) / y)) / y)) / y) / x) + t_0)); elseif (y <= 8.5e+15) tmp = Float64(1.0 - Float64(Float64(1.0 - x) * t_0)); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (y + 1.0); tmp = 0.0; if (y <= -1950.0) tmp = x * ((((1.0 + ((-1.0 + (((-1.0 / y) - -1.0) / y)) / y)) / y) / x) + t_0); elseif (y <= 8.5e+15) tmp = 1.0 - ((1.0 - x) * t_0); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1950.0], N[(x * N[(N[(N[(N[(1.0 + N[(N[(-1.0 + N[(N[(N[(-1.0 / y), $MachinePrecision] - -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+15], N[(1.0 - N[(N[(1.0 - x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{y + 1}\\
\mathbf{if}\;y \leq -1950:\\
\;\;\;\;x \cdot \left(\frac{\frac{1 + \frac{-1 + \frac{\frac{-1}{y} - -1}{y}}{y}}{y}}{x} + t\_0\right)\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;1 - \left(1 - x\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -1950Initial program 34.7%
sub-neg34.7%
+-commutative34.7%
*-commutative34.7%
associate-/l*60.3%
distribute-rgt-neg-in60.3%
fma-define60.4%
distribute-frac-neg260.4%
+-commutative60.4%
distribute-neg-in60.4%
metadata-eval60.4%
unsub-neg60.4%
Simplified60.4%
Taylor expanded in x around -inf 76.8%
associate-*r*76.8%
neg-mul-176.8%
distribute-lft-out76.8%
associate-*r*76.8%
distribute-lft-neg-in76.8%
*-commutative76.8%
neg-mul-176.8%
remove-double-neg76.8%
+-commutative76.8%
mul-1-neg76.8%
sub-neg76.8%
sub-neg76.8%
distribute-frac-neg276.8%
distribute-neg-in76.8%
metadata-eval76.8%
sub-neg76.8%
Simplified76.8%
Taylor expanded in y around -inf 99.9%
if -1950 < y < 8.5e15Initial program 99.9%
associate-/l*99.9%
+-commutative99.9%
Simplified99.9%
if 8.5e15 < y Initial program 34.4%
associate-/l*60.7%
+-commutative60.7%
Simplified60.7%
Taylor expanded in y around inf 100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= y -13600.0) (+ x (/ (+ (- 1.0 x) (/ (+ (/ (- 1.0 x) y) (+ x -1.0)) y)) y)) (if (<= y 8.5e+15) (+ 1.0 (* (- 1.0 x) (/ y (- -1.0 y)))) (+ x (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= -13600.0) {
tmp = x + (((1.0 - x) + ((((1.0 - x) / y) + (x + -1.0)) / y)) / y);
} else if (y <= 8.5e+15) {
tmp = 1.0 + ((1.0 - x) * (y / (-1.0 - y)));
} else {
tmp = x + (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 <= (-13600.0d0)) then
tmp = x + (((1.0d0 - x) + ((((1.0d0 - x) / y) + (x + (-1.0d0))) / y)) / y)
else if (y <= 8.5d+15) then
tmp = 1.0d0 + ((1.0d0 - x) * (y / ((-1.0d0) - y)))
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -13600.0) {
tmp = x + (((1.0 - x) + ((((1.0 - x) / y) + (x + -1.0)) / y)) / y);
} else if (y <= 8.5e+15) {
tmp = 1.0 + ((1.0 - x) * (y / (-1.0 - y)));
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -13600.0: tmp = x + (((1.0 - x) + ((((1.0 - x) / y) + (x + -1.0)) / y)) / y) elif y <= 8.5e+15: tmp = 1.0 + ((1.0 - x) * (y / (-1.0 - y))) else: tmp = x + (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -13600.0) tmp = Float64(x + Float64(Float64(Float64(1.0 - x) + Float64(Float64(Float64(Float64(1.0 - x) / y) + Float64(x + -1.0)) / y)) / y)); elseif (y <= 8.5e+15) tmp = Float64(1.0 + Float64(Float64(1.0 - x) * Float64(y / Float64(-1.0 - y)))); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -13600.0) tmp = x + (((1.0 - x) + ((((1.0 - x) / y) + (x + -1.0)) / y)) / y); elseif (y <= 8.5e+15) tmp = 1.0 + ((1.0 - x) * (y / (-1.0 - y))); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -13600.0], N[(x + N[(N[(N[(1.0 - x), $MachinePrecision] + N[(N[(N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision] + N[(x + -1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+15], N[(1.0 + N[(N[(1.0 - x), $MachinePrecision] * N[(y / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -13600:\\
\;\;\;\;x + \frac{\left(1 - x\right) + \frac{\frac{1 - x}{y} + \left(x + -1\right)}{y}}{y}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(1 - x\right) \cdot \frac{y}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -13600Initial program 34.7%
associate-/l*60.4%
+-commutative60.4%
Simplified60.4%
Taylor expanded in y around -inf 99.8%
Simplified99.8%
if -13600 < y < 8.5e15Initial program 99.9%
associate-/l*99.9%
+-commutative99.9%
Simplified99.9%
if 8.5e15 < y Initial program 34.4%
associate-/l*60.7%
+-commutative60.7%
Simplified60.7%
Taylor expanded in y around inf 100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= y -270000.0) (+ x (/ (+ (- 1.0 x) (/ (+ x -1.0) y)) y)) (if (<= y 8.5e+15) (- 1.0 (* (- 1.0 x) (/ y (+ y 1.0)))) (+ x (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= -270000.0) {
tmp = x + (((1.0 - x) + ((x + -1.0) / y)) / y);
} else if (y <= 8.5e+15) {
tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0)));
} else {
tmp = x + (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 <= (-270000.0d0)) then
tmp = x + (((1.0d0 - x) + ((x + (-1.0d0)) / y)) / y)
else if (y <= 8.5d+15) then
tmp = 1.0d0 - ((1.0d0 - x) * (y / (y + 1.0d0)))
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -270000.0) {
tmp = x + (((1.0 - x) + ((x + -1.0) / y)) / y);
} else if (y <= 8.5e+15) {
tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0)));
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -270000.0: tmp = x + (((1.0 - x) + ((x + -1.0) / y)) / y) elif y <= 8.5e+15: tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0))) else: tmp = x + (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -270000.0) tmp = Float64(x + Float64(Float64(Float64(1.0 - x) + Float64(Float64(x + -1.0) / y)) / y)); elseif (y <= 8.5e+15) tmp = Float64(1.0 - Float64(Float64(1.0 - x) * Float64(y / Float64(y + 1.0)))); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -270000.0) tmp = x + (((1.0 - x) + ((x + -1.0) / y)) / y); elseif (y <= 8.5e+15) tmp = 1.0 - ((1.0 - x) * (y / (y + 1.0))); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -270000.0], N[(x + N[(N[(N[(1.0 - x), $MachinePrecision] + N[(N[(x + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+15], N[(1.0 - N[(N[(1.0 - x), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -270000:\\
\;\;\;\;x + \frac{\left(1 - x\right) + \frac{x + -1}{y}}{y}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;1 - \left(1 - x\right) \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -2.7e5Initial program 33.9%
associate-/l*60.1%
+-commutative60.1%
Simplified60.1%
Taylor expanded in y around -inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
if -2.7e5 < y < 8.5e15Initial program 99.7%
associate-/l*99.7%
+-commutative99.7%
Simplified99.7%
if 8.5e15 < y Initial program 34.4%
associate-/l*60.7%
+-commutative60.7%
Simplified60.7%
Taylor expanded in y around inf 100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= y -430000000.0) (- x (/ (+ -1.0 (/ 1.0 y)) y)) (if (<= y 8.5e+15) (+ 1.0 (/ y (/ (+ y 1.0) (+ x -1.0)))) (+ x (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= -430000000.0) {
tmp = x - ((-1.0 + (1.0 / y)) / y);
} else if (y <= 8.5e+15) {
tmp = 1.0 + (y / ((y + 1.0) / (x + -1.0)));
} else {
tmp = x + (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 <= (-430000000.0d0)) then
tmp = x - (((-1.0d0) + (1.0d0 / y)) / y)
else if (y <= 8.5d+15) then
tmp = 1.0d0 + (y / ((y + 1.0d0) / (x + (-1.0d0))))
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -430000000.0) {
tmp = x - ((-1.0 + (1.0 / y)) / y);
} else if (y <= 8.5e+15) {
tmp = 1.0 + (y / ((y + 1.0) / (x + -1.0)));
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -430000000.0: tmp = x - ((-1.0 + (1.0 / y)) / y) elif y <= 8.5e+15: tmp = 1.0 + (y / ((y + 1.0) / (x + -1.0))) else: tmp = x + (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -430000000.0) tmp = Float64(x - Float64(Float64(-1.0 + Float64(1.0 / y)) / y)); elseif (y <= 8.5e+15) tmp = Float64(1.0 + Float64(y / Float64(Float64(y + 1.0) / Float64(x + -1.0)))); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -430000000.0) tmp = x - ((-1.0 + (1.0 / y)) / y); elseif (y <= 8.5e+15) tmp = 1.0 + (y / ((y + 1.0) / (x + -1.0))); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -430000000.0], N[(x - N[(N[(-1.0 + N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+15], N[(1.0 + N[(y / N[(N[(y + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -430000000:\\
\;\;\;\;x - \frac{-1 + \frac{1}{y}}{y}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;1 + \frac{y}{\frac{y + 1}{x + -1}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -4.3e8Initial program 32.6%
associate-/l*59.3%
+-commutative59.3%
Simplified59.3%
Taylor expanded in y around -inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 99.5%
if -4.3e8 < y < 8.5e15Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
associate-/l*99.7%
distribute-rgt-neg-in99.7%
fma-define99.7%
distribute-frac-neg299.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
fma-undefine99.7%
clear-num99.7%
un-div-inv99.7%
Applied egg-rr99.7%
if 8.5e15 < y Initial program 34.4%
associate-/l*60.7%
+-commutative60.7%
Simplified60.7%
Taylor expanded in y around inf 100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification99.7%
(FPCore (x y) :precision binary64 (if (or (<= y -900.0) (not (<= y 13000.0))) (+ x (/ (- 1.0 x) y)) (+ 1.0 (/ (* y x) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -900.0) || !(y <= 13000.0)) {
tmp = x + ((1.0 - x) / y);
} else {
tmp = 1.0 + ((y * x) / (y + 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 <= (-900.0d0)) .or. (.not. (y <= 13000.0d0))) then
tmp = x + ((1.0d0 - x) / y)
else
tmp = 1.0d0 + ((y * x) / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -900.0) || !(y <= 13000.0)) {
tmp = x + ((1.0 - x) / y);
} else {
tmp = 1.0 + ((y * x) / (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -900.0) or not (y <= 13000.0): tmp = x + ((1.0 - x) / y) else: tmp = 1.0 + ((y * x) / (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -900.0) || !(y <= 13000.0)) tmp = Float64(x + Float64(Float64(1.0 - x) / y)); else tmp = Float64(1.0 + Float64(Float64(y * x) / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -900.0) || ~((y <= 13000.0))) tmp = x + ((1.0 - x) / y); else tmp = 1.0 + ((y * x) / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -900.0], N[Not[LessEqual[y, 13000.0]], $MachinePrecision]], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(y * x), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -900 \lor \neg \left(y \leq 13000\right):\\
\;\;\;\;x + \frac{1 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot x}{y + 1}\\
\end{array}
\end{array}
if y < -900 or 13000 < y Initial program 36.1%
associate-/l*61.5%
+-commutative61.5%
Simplified61.5%
Taylor expanded in y around inf 99.1%
associate--l+99.1%
div-sub99.1%
Simplified99.1%
if -900 < y < 13000Initial program 99.9%
associate-/l*99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 98.7%
mul-1-neg98.7%
distribute-neg-frac298.7%
*-commutative98.7%
distribute-neg-in98.7%
metadata-eval98.7%
sub-neg98.7%
Simplified98.7%
Final simplification98.9%
(FPCore (x y) :precision binary64 (if (<= y -900.0) (+ x (/ (- (/ -1.0 y) -1.0) y)) (if (<= y 130000.0) (+ 1.0 (/ (* y x) (+ y 1.0))) (+ x (/ (- 1.0 x) y)))))
double code(double x, double y) {
double tmp;
if (y <= -900.0) {
tmp = x + (((-1.0 / y) - -1.0) / y);
} else if (y <= 130000.0) {
tmp = 1.0 + ((y * x) / (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 <= (-900.0d0)) then
tmp = x + ((((-1.0d0) / y) - (-1.0d0)) / y)
else if (y <= 130000.0d0) then
tmp = 1.0d0 + ((y * x) / (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 <= -900.0) {
tmp = x + (((-1.0 / y) - -1.0) / y);
} else if (y <= 130000.0) {
tmp = 1.0 + ((y * x) / (y + 1.0));
} else {
tmp = x + ((1.0 - x) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -900.0: tmp = x + (((-1.0 / y) - -1.0) / y) elif y <= 130000.0: tmp = 1.0 + ((y * x) / (y + 1.0)) else: tmp = x + ((1.0 - x) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -900.0) tmp = Float64(x + Float64(Float64(Float64(-1.0 / y) - -1.0) / y)); elseif (y <= 130000.0) tmp = Float64(1.0 + Float64(Float64(y * x) / 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 <= -900.0) tmp = x + (((-1.0 / y) - -1.0) / y); elseif (y <= 130000.0) tmp = 1.0 + ((y * x) / (y + 1.0)); else tmp = x + ((1.0 - x) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -900.0], N[(x + N[(N[(N[(-1.0 / y), $MachinePrecision] - -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 130000.0], N[(1.0 + N[(N[(y * x), $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 -900:\\
\;\;\;\;x + \frac{\frac{-1}{y} - -1}{y}\\
\mathbf{elif}\;y \leq 130000:\\
\;\;\;\;1 + \frac{y \cdot x}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\end{array}
\end{array}
if y < -900Initial program 34.7%
associate-/l*60.4%
+-commutative60.4%
Simplified60.4%
Taylor expanded in y around -inf 99.4%
mul-1-neg99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 98.1%
if -900 < y < 1.3e5Initial program 99.9%
associate-/l*99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 98.7%
mul-1-neg98.7%
distribute-neg-frac298.7%
*-commutative98.7%
distribute-neg-in98.7%
metadata-eval98.7%
sub-neg98.7%
Simplified98.7%
if 1.3e5 < y Initial program 37.2%
associate-/l*62.4%
+-commutative62.4%
Simplified62.4%
Taylor expanded in y around inf 100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Final simplification98.9%
(FPCore (x y) :precision binary64 (if (<= y -1700.0) (+ x (/ (- 1.0 x) y)) (if (<= y 8.5e+15) (+ 1.0 (/ y (/ (+ y 1.0) x))) (+ x (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= -1700.0) {
tmp = x + ((1.0 - x) / y);
} else if (y <= 8.5e+15) {
tmp = 1.0 + (y / ((y + 1.0) / x));
} else {
tmp = x + (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 <= (-1700.0d0)) then
tmp = x + ((1.0d0 - x) / y)
else if (y <= 8.5d+15) then
tmp = 1.0d0 + (y / ((y + 1.0d0) / x))
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1700.0) {
tmp = x + ((1.0 - x) / y);
} else if (y <= 8.5e+15) {
tmp = 1.0 + (y / ((y + 1.0) / x));
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1700.0: tmp = x + ((1.0 - x) / y) elif y <= 8.5e+15: tmp = 1.0 + (y / ((y + 1.0) / x)) else: tmp = x + (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -1700.0) tmp = Float64(x + Float64(Float64(1.0 - x) / y)); elseif (y <= 8.5e+15) tmp = Float64(1.0 + Float64(y / Float64(Float64(y + 1.0) / x))); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1700.0) tmp = x + ((1.0 - x) / y); elseif (y <= 8.5e+15) tmp = 1.0 + (y / ((y + 1.0) / x)); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1700.0], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+15], N[(1.0 + N[(y / N[(N[(y + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1700:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;1 + \frac{y}{\frac{y + 1}{x}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -1700Initial program 34.7%
associate-/l*60.4%
+-commutative60.4%
Simplified60.4%
Taylor expanded in y around inf 98.0%
associate--l+98.0%
div-sub98.0%
Simplified98.0%
if -1700 < y < 8.5e15Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
associate-/l*99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
distribute-frac-neg299.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
fma-undefine99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 98.6%
if 8.5e15 < y Initial program 34.4%
associate-/l*60.7%
+-commutative60.7%
Simplified60.7%
Taylor expanded in y around inf 100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification98.9%
(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 38.0%
associate-/l*62.7%
+-commutative62.7%
Simplified62.7%
Taylor expanded in y around inf 97.0%
associate--l+97.0%
div-sub97.0%
Simplified97.0%
if -1 < y < 1Initial program 100.0%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 97.8%
Final simplification97.4%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 1.22))) (+ x (/ (- 1.0 x) y)) (+ 1.0 (* y x))))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.22)) {
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.22d0))) 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.22)) {
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.22): 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.22)) 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.22))) 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.22]], $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.22\right):\\
\;\;\;\;x + \frac{1 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot x\\
\end{array}
\end{array}
if y < -1 or 1.21999999999999997 < y Initial program 38.0%
associate-/l*62.7%
+-commutative62.7%
Simplified62.7%
Taylor expanded in y around inf 97.0%
associate--l+97.0%
div-sub97.0%
Simplified97.0%
if -1 < y < 1.21999999999999997Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-rgt-neg-in100.0%
fma-define100.0%
distribute-frac-neg2100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
fma-undefine100.0%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 99.2%
Taylor expanded in y around 0 97.6%
*-commutative97.6%
Simplified97.6%
Final simplification97.3%
(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 38.0%
associate-/l*62.7%
+-commutative62.7%
Simplified62.7%
Taylor expanded in y around inf 97.0%
associate--l+97.0%
div-sub97.0%
Simplified97.0%
Taylor expanded in x around 0 95.8%
if -1 < y < 1Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-rgt-neg-in100.0%
fma-define100.0%
distribute-frac-neg2100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
fma-undefine100.0%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 99.2%
Taylor expanded in y around 0 97.6%
*-commutative97.6%
Simplified97.6%
Final simplification96.7%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 38.0) (+ 1.0 (* y x)) x)))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 38.0) {
tmp = 1.0 + (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 <= 38.0d0) then
tmp = 1.0d0 + (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 <= 38.0) {
tmp = 1.0 + (y * x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 38.0: tmp = 1.0 + (y * x) else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 38.0) tmp = Float64(1.0 + 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 <= 38.0) tmp = 1.0 + (y * x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 38.0], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 38:\\
\;\;\;\;1 + y \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 38 < y Initial program 37.1%
associate-/l*62.1%
+-commutative62.1%
Simplified62.1%
Taylor expanded in y around inf 77.4%
if -1 < y < 38Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
associate-/l*99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
distribute-frac-neg299.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
fma-undefine99.9%
clear-num99.9%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 98.6%
Taylor expanded in y around 0 96.4%
*-commutative96.4%
Simplified96.4%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 0.0076) 1.0 x)))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 0.0076) {
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.0076d0) 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.0076) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 0.0076: tmp = 1.0 else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 0.0076) 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.0076) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 0.0076], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 0.0076:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 0.00759999999999999998 < y Initial program 38.5%
associate-/l*63.0%
+-commutative63.0%
Simplified63.0%
Taylor expanded in y around inf 75.9%
if -1 < y < 0.00759999999999999998Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-rgt-neg-in100.0%
fma-define100.0%
distribute-frac-neg2100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around -inf 99.7%
associate-*r*99.7%
neg-mul-199.7%
distribute-lft-out99.7%
associate-*r*99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
neg-mul-199.7%
remove-double-neg99.7%
+-commutative99.7%
mul-1-neg99.7%
sub-neg99.7%
sub-neg99.7%
distribute-frac-neg299.7%
distribute-neg-in99.7%
metadata-eval99.7%
sub-neg99.7%
Simplified99.7%
add-cube-cbrt99.6%
pow399.5%
Applied egg-rr99.5%
Taylor expanded in y around 0 78.5%
(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 69.2%
sub-neg69.2%
+-commutative69.2%
*-commutative69.2%
associate-/l*81.4%
distribute-rgt-neg-in81.4%
fma-define81.5%
distribute-frac-neg281.5%
+-commutative81.5%
distribute-neg-in81.5%
metadata-eval81.5%
unsub-neg81.5%
Simplified81.5%
Taylor expanded in x around -inf 90.5%
associate-*r*90.5%
neg-mul-190.5%
distribute-lft-out90.5%
associate-*r*90.5%
distribute-lft-neg-in90.5%
*-commutative90.5%
neg-mul-190.5%
remove-double-neg90.5%
+-commutative90.5%
mul-1-neg90.5%
sub-neg90.5%
sub-neg90.5%
distribute-frac-neg290.5%
distribute-neg-in90.5%
metadata-eval90.5%
sub-neg90.5%
Simplified90.5%
add-cube-cbrt89.6%
pow389.6%
Applied egg-rr89.6%
Taylor expanded in y around 0 41.1%
(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 2024129
(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))))