
(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 (or (<= y -550000.0) (not (<= y 430000.0))) (+ x (- (/ (+ x -1.0) (* y y)) (/ (+ x -1.0) y))) (fma (/ (+ x -1.0) (+ y 1.0)) y 1.0)))
double code(double x, double y) {
double tmp;
if ((y <= -550000.0) || !(y <= 430000.0)) {
tmp = x + (((x + -1.0) / (y * y)) - ((x + -1.0) / y));
} else {
tmp = fma(((x + -1.0) / (y + 1.0)), y, 1.0);
}
return tmp;
}
function code(x, y) tmp = 0.0 if ((y <= -550000.0) || !(y <= 430000.0)) tmp = Float64(x + Float64(Float64(Float64(x + -1.0) / Float64(y * y)) - Float64(Float64(x + -1.0) / y))); else tmp = fma(Float64(Float64(x + -1.0) / Float64(y + 1.0)), y, 1.0); end return tmp end
code[x_, y_] := If[Or[LessEqual[y, -550000.0], N[Not[LessEqual[y, 430000.0]], $MachinePrecision]], N[(x + N[(N[(N[(x + -1.0), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(N[(x + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + -1.0), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * y + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -550000 \lor \neg \left(y \leq 430000\right):\\
\;\;\;\;x + \left(\frac{x + -1}{y \cdot y} - \frac{x + -1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x + -1}{y + 1}, y, 1\right)\\
\end{array}
\end{array}
if y < -5.5e5 or 4.3e5 < y Initial program 30.2%
Taylor expanded in y around -inf 100.0%
associate--l+100.0%
associate--l+100.0%
mul-1-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
sub-neg100.0%
div-sub100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
unpow2100.0%
Simplified100.0%
if -5.5e5 < y < 4.3e5Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
associate-*l/99.9%
distribute-lft-neg-in99.9%
fma-def99.9%
*-rgt-identity99.9%
*-rgt-identity99.9%
distribute-frac-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* y (- 1.0 x)) (+ y 1.0))))
(if (or (<= t_0 0.1) (not (<= t_0 1.001)))
(+ 1.0 (* y (/ (+ x -1.0) (+ y 1.0))))
(+ x (+ (/ 1.0 y) (/ -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.1) || !(t_0 <= 1.001)) {
tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)));
} else {
tmp = x + ((1.0 / y) + (-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.1d0) .or. (.not. (t_0 <= 1.001d0))) then
tmp = 1.0d0 + (y * ((x + (-1.0d0)) / (y + 1.0d0)))
else
tmp = x + ((1.0d0 / y) + ((-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.1) || !(t_0 <= 1.001)) {
tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)));
} else {
tmp = x + ((1.0 / y) + (-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.1) or not (t_0 <= 1.001): tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0))) else: tmp = x + ((1.0 / y) + (-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.1) || !(t_0 <= 1.001)) tmp = Float64(1.0 + Float64(y * Float64(Float64(x + -1.0) / Float64(y + 1.0)))); else tmp = Float64(x + Float64(Float64(1.0 / y) + Float64(-1.0 / Float64(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.1) || ~((t_0 <= 1.001))) tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0))); else tmp = x + ((1.0 / y) + (-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.1], N[Not[LessEqual[t$95$0, 1.001]], $MachinePrecision]], N[(1.0 + N[(y * N[(N[(x + -1.0), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(1.0 / y), $MachinePrecision] + N[(-1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $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.1 \lor \neg \left(t_0 \leq 1.001\right):\\
\;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\frac{1}{y} + \frac{-1}{y \cdot y}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)) < 0.10000000000000001 or 1.0009999999999999 < (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)) Initial program 84.4%
sub-neg84.4%
associate-*l/99.8%
distribute-lft-neg-in99.8%
distribute-frac-neg99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
if 0.10000000000000001 < (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)) < 1.0009999999999999Initial program 7.8%
Taylor expanded in y around -inf 100.0%
associate--l+100.0%
associate--l+100.0%
mul-1-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
sub-neg100.0%
div-sub100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* y (- 1.0 x)) (+ y 1.0))))
(if (<= t_0 0.1)
(+ 1.0 (/ (+ x -1.0) (+ 1.0 (/ 1.0 y))))
(if (<= t_0 1.001)
(+ x (+ (/ 1.0 y) (/ -1.0 (* y y))))
(+ 1.0 (* y (/ (+ x -1.0) (+ y 1.0))))))))
double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (y + 1.0);
double tmp;
if (t_0 <= 0.1) {
tmp = 1.0 + ((x + -1.0) / (1.0 + (1.0 / y)));
} else if (t_0 <= 1.001) {
tmp = x + ((1.0 / y) + (-1.0 / (y * y)));
} else {
tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (y * (1.0d0 - x)) / (y + 1.0d0)
if (t_0 <= 0.1d0) then
tmp = 1.0d0 + ((x + (-1.0d0)) / (1.0d0 + (1.0d0 / y)))
else if (t_0 <= 1.001d0) then
tmp = x + ((1.0d0 / y) + ((-1.0d0) / (y * y)))
else
tmp = 1.0d0 + (y * ((x + (-1.0d0)) / (y + 1.0d0)))
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.1) {
tmp = 1.0 + ((x + -1.0) / (1.0 + (1.0 / y)));
} else if (t_0 <= 1.001) {
tmp = x + ((1.0 / y) + (-1.0 / (y * y)));
} else {
tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)));
}
return tmp;
}
def code(x, y): t_0 = (y * (1.0 - x)) / (y + 1.0) tmp = 0 if t_0 <= 0.1: tmp = 1.0 + ((x + -1.0) / (1.0 + (1.0 / y))) elif t_0 <= 1.001: tmp = x + ((1.0 / y) + (-1.0 / (y * y))) else: tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0))) 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.1) tmp = Float64(1.0 + Float64(Float64(x + -1.0) / Float64(1.0 + Float64(1.0 / y)))); elseif (t_0 <= 1.001) tmp = Float64(x + Float64(Float64(1.0 / y) + Float64(-1.0 / Float64(y * y)))); else tmp = Float64(1.0 + Float64(y * Float64(Float64(x + -1.0) / Float64(y + 1.0)))); 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.1) tmp = 1.0 + ((x + -1.0) / (1.0 + (1.0 / y))); elseif (t_0 <= 1.001) tmp = x + ((1.0 / y) + (-1.0 / (y * y))); else tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0))); 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[LessEqual[t$95$0, 0.1], N[(1.0 + N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.001], N[(x + N[(N[(1.0 / y), $MachinePrecision] + N[(-1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(N[(x + -1.0), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $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.1:\\
\;\;\;\;1 + \frac{x + -1}{1 + \frac{1}{y}}\\
\mathbf{elif}\;t_0 \leq 1.001:\\
\;\;\;\;x + \left(\frac{1}{y} + \frac{-1}{y \cdot y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)) < 0.10000000000000001Initial program 86.5%
sub-neg86.5%
metadata-eval86.5%
associate--r-86.5%
neg-sub086.5%
remove-double-neg86.5%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
if 0.10000000000000001 < (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)) < 1.0009999999999999Initial program 7.8%
Taylor expanded in y around -inf 100.0%
associate--l+100.0%
associate--l+100.0%
mul-1-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
sub-neg100.0%
div-sub100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
if 1.0009999999999999 < (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)) Initial program 77.8%
sub-neg77.8%
associate-*l/99.5%
distribute-lft-neg-in99.5%
distribute-frac-neg99.5%
neg-sub099.5%
associate--r-99.5%
metadata-eval99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (or (<= y -370000.0) (not (<= y 510000.0))) (+ x (- (/ (+ x -1.0) (* y y)) (/ (+ x -1.0) y))) (+ 1.0 (* y (/ (+ x -1.0) (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if ((y <= -370000.0) || !(y <= 510000.0)) {
tmp = x + (((x + -1.0) / (y * y)) - ((x + -1.0) / y));
} else {
tmp = 1.0 + (y * ((x + -1.0) / (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 <= (-370000.0d0)) .or. (.not. (y <= 510000.0d0))) then
tmp = x + (((x + (-1.0d0)) / (y * y)) - ((x + (-1.0d0)) / y))
else
tmp = 1.0d0 + (y * ((x + (-1.0d0)) / (y + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -370000.0) || !(y <= 510000.0)) {
tmp = x + (((x + -1.0) / (y * y)) - ((x + -1.0) / y));
} else {
tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -370000.0) or not (y <= 510000.0): tmp = x + (((x + -1.0) / (y * y)) - ((x + -1.0) / y)) else: tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0))) return tmp
function code(x, y) tmp = 0.0 if ((y <= -370000.0) || !(y <= 510000.0)) tmp = Float64(x + Float64(Float64(Float64(x + -1.0) / Float64(y * y)) - Float64(Float64(x + -1.0) / y))); else tmp = Float64(1.0 + Float64(y * Float64(Float64(x + -1.0) / Float64(y + 1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -370000.0) || ~((y <= 510000.0))) tmp = x + (((x + -1.0) / (y * y)) - ((x + -1.0) / y)); else tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -370000.0], N[Not[LessEqual[y, 510000.0]], $MachinePrecision]], N[(x + N[(N[(N[(x + -1.0), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(N[(x + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(N[(x + -1.0), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -370000 \lor \neg \left(y \leq 510000\right):\\
\;\;\;\;x + \left(\frac{x + -1}{y \cdot y} - \frac{x + -1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\
\end{array}
\end{array}
if y < -3.7e5 or 5.1e5 < y Initial program 30.2%
Taylor expanded in y around -inf 100.0%
associate--l+100.0%
associate--l+100.0%
mul-1-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
sub-neg100.0%
div-sub100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
unpow2100.0%
Simplified100.0%
if -3.7e5 < y < 5.1e5Initial program 99.9%
sub-neg99.9%
associate-*l/99.9%
distribute-lft-neg-in99.9%
distribute-frac-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (or (<= y -94000000.0) (not (<= y 240000000.0))) (+ x (/ (- 1.0 x) y)) (+ 1.0 (* y (/ (+ x -1.0) (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if ((y <= -94000000.0) || !(y <= 240000000.0)) {
tmp = x + ((1.0 - x) / y);
} else {
tmp = 1.0 + (y * ((x + -1.0) / (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 <= (-94000000.0d0)) .or. (.not. (y <= 240000000.0d0))) then
tmp = x + ((1.0d0 - x) / y)
else
tmp = 1.0d0 + (y * ((x + (-1.0d0)) / (y + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -94000000.0) || !(y <= 240000000.0)) {
tmp = x + ((1.0 - x) / y);
} else {
tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -94000000.0) or not (y <= 240000000.0): tmp = x + ((1.0 - x) / y) else: tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0))) return tmp
function code(x, y) tmp = 0.0 if ((y <= -94000000.0) || !(y <= 240000000.0)) tmp = Float64(x + Float64(Float64(1.0 - x) / y)); else tmp = Float64(1.0 + Float64(y * Float64(Float64(x + -1.0) / Float64(y + 1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -94000000.0) || ~((y <= 240000000.0))) tmp = x + ((1.0 - x) / y); else tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -94000000.0], N[Not[LessEqual[y, 240000000.0]], $MachinePrecision]], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(N[(x + -1.0), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -94000000 \lor \neg \left(y \leq 240000000\right):\\
\;\;\;\;x + \frac{1 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\
\end{array}
\end{array}
if y < -9.4e7 or 2.4e8 < y Initial program 29.4%
Taylor expanded in y around -inf 99.8%
mul-1-neg99.8%
sub-neg99.8%
metadata-eval99.8%
distribute-neg-frac99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
sub-neg99.8%
Simplified99.8%
if -9.4e7 < y < 2.4e8Initial program 99.6%
sub-neg99.6%
associate-*l/99.6%
distribute-lft-neg-in99.6%
distribute-frac-neg99.6%
neg-sub099.6%
associate--r-99.6%
metadata-eval99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.7%
(FPCore (x y)
:precision binary64
(if (<= y -1.06e+99)
x
(if (<= y -1.08e+46)
(/ 1.0 y)
(if (or (<= y -1.0) (not (<= y 1.62))) (- x (/ x y)) (+ 1.0 (* y x))))))
double code(double x, double y) {
double tmp;
if (y <= -1.06e+99) {
tmp = x;
} else if (y <= -1.08e+46) {
tmp = 1.0 / y;
} else if ((y <= -1.0) || !(y <= 1.62)) {
tmp = x - (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.06d+99)) then
tmp = x
else if (y <= (-1.08d+46)) then
tmp = 1.0d0 / y
else if ((y <= (-1.0d0)) .or. (.not. (y <= 1.62d0))) then
tmp = x - (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.06e+99) {
tmp = x;
} else if (y <= -1.08e+46) {
tmp = 1.0 / y;
} else if ((y <= -1.0) || !(y <= 1.62)) {
tmp = x - (x / y);
} else {
tmp = 1.0 + (y * x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.06e+99: tmp = x elif y <= -1.08e+46: tmp = 1.0 / y elif (y <= -1.0) or not (y <= 1.62): tmp = x - (x / y) else: tmp = 1.0 + (y * x) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.06e+99) tmp = x; elseif (y <= -1.08e+46) tmp = Float64(1.0 / y); elseif ((y <= -1.0) || !(y <= 1.62)) tmp = Float64(x - Float64(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.06e+99) tmp = x; elseif (y <= -1.08e+46) tmp = 1.0 / y; elseif ((y <= -1.0) || ~((y <= 1.62))) tmp = x - (x / y); else tmp = 1.0 + (y * x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.06e+99], x, If[LessEqual[y, -1.08e+46], N[(1.0 / y), $MachinePrecision], If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 1.62]], $MachinePrecision]], N[(x - N[(x / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+99}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.08 \cdot 10^{+46}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{elif}\;y \leq -1 \lor \neg \left(y \leq 1.62\right):\\
\;\;\;\;x - \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot x\\
\end{array}
\end{array}
if y < -1.05999999999999999e99Initial program 24.0%
sub-neg24.0%
associate-*l/53.5%
distribute-lft-neg-in53.5%
distribute-frac-neg53.5%
neg-sub053.5%
associate--r-53.5%
metadata-eval53.5%
+-commutative53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in y around inf 91.9%
if -1.05999999999999999e99 < y < -1.07999999999999994e46Initial program 33.7%
sub-neg33.7%
associate-*l/33.3%
distribute-lft-neg-in33.3%
distribute-frac-neg33.3%
neg-sub033.3%
associate--r-33.3%
metadata-eval33.3%
+-commutative33.3%
+-commutative33.3%
Simplified33.3%
Taylor expanded in x around 0 3.4%
neg-mul-13.4%
sub-neg3.4%
Simplified3.4%
Taylor expanded in y around inf 70.1%
if -1.07999999999999994e46 < y < -1 or 1.6200000000000001 < y Initial program 35.6%
sub-neg35.6%
associate-*l/60.7%
distribute-lft-neg-in60.7%
distribute-frac-neg60.7%
neg-sub060.7%
associate--r-60.7%
metadata-eval60.7%
+-commutative60.7%
+-commutative60.7%
Simplified60.7%
Taylor expanded in x around inf 52.3%
Taylor expanded in y around inf 75.3%
neg-mul-175.3%
unsub-neg75.3%
Simplified75.3%
if -1 < y < 1.6200000000000001Initial program 100.0%
sub-neg100.0%
associate-*l/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.7%
Taylor expanded in y around 0 98.5%
Final simplification88.8%
(FPCore (x y)
:precision binary64
(if (<= y -1.06e+99)
x
(if (<= y -5.5e+45)
(/ 1.0 y)
(if (<= y -1.0) (* y (/ x y)) (if (<= y 1.9) (+ 1.0 (* y x)) x)))))
double code(double x, double y) {
double tmp;
if (y <= -1.06e+99) {
tmp = x;
} else if (y <= -5.5e+45) {
tmp = 1.0 / y;
} else if (y <= -1.0) {
tmp = y * (x / y);
} else if (y <= 1.9) {
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.06d+99)) then
tmp = x
else if (y <= (-5.5d+45)) then
tmp = 1.0d0 / y
else if (y <= (-1.0d0)) then
tmp = y * (x / y)
else if (y <= 1.9d0) 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.06e+99) {
tmp = x;
} else if (y <= -5.5e+45) {
tmp = 1.0 / y;
} else if (y <= -1.0) {
tmp = y * (x / y);
} else if (y <= 1.9) {
tmp = 1.0 + (y * x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.06e+99: tmp = x elif y <= -5.5e+45: tmp = 1.0 / y elif y <= -1.0: tmp = y * (x / y) elif y <= 1.9: tmp = 1.0 + (y * x) else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.06e+99) tmp = x; elseif (y <= -5.5e+45) tmp = Float64(1.0 / y); elseif (y <= -1.0) tmp = Float64(y * Float64(x / y)); elseif (y <= 1.9) 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.06e+99) tmp = x; elseif (y <= -5.5e+45) tmp = 1.0 / y; elseif (y <= -1.0) tmp = y * (x / y); elseif (y <= 1.9) tmp = 1.0 + (y * x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.06e+99], x, If[LessEqual[y, -5.5e+45], N[(1.0 / y), $MachinePrecision], If[LessEqual[y, -1.0], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+99}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{+45}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq 1.9:\\
\;\;\;\;1 + y \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.05999999999999999e99 or 1.8999999999999999 < y Initial program 27.5%
sub-neg27.5%
associate-*l/55.3%
distribute-lft-neg-in55.3%
distribute-frac-neg55.3%
neg-sub055.3%
associate--r-55.3%
metadata-eval55.3%
+-commutative55.3%
+-commutative55.3%
Simplified55.3%
Taylor expanded in y around inf 80.5%
if -1.05999999999999999e99 < y < -5.5000000000000001e45Initial program 33.7%
sub-neg33.7%
associate-*l/33.3%
distribute-lft-neg-in33.3%
distribute-frac-neg33.3%
neg-sub033.3%
associate--r-33.3%
metadata-eval33.3%
+-commutative33.3%
+-commutative33.3%
Simplified33.3%
Taylor expanded in x around 0 3.4%
neg-mul-13.4%
sub-neg3.4%
Simplified3.4%
Taylor expanded in y around inf 70.1%
if -5.5000000000000001e45 < y < -1Initial program 70.1%
sub-neg70.1%
associate-*l/84.9%
distribute-lft-neg-in84.9%
distribute-frac-neg84.9%
neg-sub084.9%
associate--r-84.9%
metadata-eval84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
Taylor expanded in x around inf 60.8%
associate-/l*76.0%
associate-/r/75.9%
Applied egg-rr75.9%
Taylor expanded in y around inf 71.6%
if -1 < y < 1.8999999999999999Initial program 100.0%
sub-neg100.0%
associate-*l/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.7%
Taylor expanded in y around 0 98.5%
Final simplification88.4%
(FPCore (x y)
:precision binary64
(if (<= y -1.06e+99)
x
(if (<= y -1.1e+46)
(/ 1.0 y)
(if (<= y -5e-8)
(* y (/ x (+ y 1.0)))
(if (<= y 1.9) (+ 1.0 (* y x)) (- x (/ x y)))))))
double code(double x, double y) {
double tmp;
if (y <= -1.06e+99) {
tmp = x;
} else if (y <= -1.1e+46) {
tmp = 1.0 / y;
} else if (y <= -5e-8) {
tmp = y * (x / (y + 1.0));
} else if (y <= 1.9) {
tmp = 1.0 + (y * x);
} else {
tmp = x - (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.06d+99)) then
tmp = x
else if (y <= (-1.1d+46)) then
tmp = 1.0d0 / y
else if (y <= (-5d-8)) then
tmp = y * (x / (y + 1.0d0))
else if (y <= 1.9d0) then
tmp = 1.0d0 + (y * x)
else
tmp = x - (x / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.06e+99) {
tmp = x;
} else if (y <= -1.1e+46) {
tmp = 1.0 / y;
} else if (y <= -5e-8) {
tmp = y * (x / (y + 1.0));
} else if (y <= 1.9) {
tmp = 1.0 + (y * x);
} else {
tmp = x - (x / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.06e+99: tmp = x elif y <= -1.1e+46: tmp = 1.0 / y elif y <= -5e-8: tmp = y * (x / (y + 1.0)) elif y <= 1.9: tmp = 1.0 + (y * x) else: tmp = x - (x / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.06e+99) tmp = x; elseif (y <= -1.1e+46) tmp = Float64(1.0 / y); elseif (y <= -5e-8) tmp = Float64(y * Float64(x / Float64(y + 1.0))); elseif (y <= 1.9) tmp = Float64(1.0 + Float64(y * x)); else tmp = Float64(x - Float64(x / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.06e+99) tmp = x; elseif (y <= -1.1e+46) tmp = 1.0 / y; elseif (y <= -5e-8) tmp = y * (x / (y + 1.0)); elseif (y <= 1.9) tmp = 1.0 + (y * x); else tmp = x - (x / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.06e+99], x, If[LessEqual[y, -1.1e+46], N[(1.0 / y), $MachinePrecision], If[LessEqual[y, -5e-8], N[(y * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision], N[(x - N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+99}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{+46}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-8}:\\
\;\;\;\;y \cdot \frac{x}{y + 1}\\
\mathbf{elif}\;y \leq 1.9:\\
\;\;\;\;1 + y \cdot x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x}{y}\\
\end{array}
\end{array}
if y < -1.05999999999999999e99Initial program 24.0%
sub-neg24.0%
associate-*l/53.5%
distribute-lft-neg-in53.5%
distribute-frac-neg53.5%
neg-sub053.5%
associate--r-53.5%
metadata-eval53.5%
+-commutative53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in y around inf 91.9%
if -1.05999999999999999e99 < y < -1.1e46Initial program 33.7%
sub-neg33.7%
associate-*l/33.3%
distribute-lft-neg-in33.3%
distribute-frac-neg33.3%
neg-sub033.3%
associate--r-33.3%
metadata-eval33.3%
+-commutative33.3%
+-commutative33.3%
Simplified33.3%
Taylor expanded in x around 0 3.4%
neg-mul-13.4%
sub-neg3.4%
Simplified3.4%
Taylor expanded in y around inf 70.1%
if -1.1e46 < y < -4.9999999999999998e-8Initial program 74.3%
sub-neg74.3%
associate-*l/86.9%
distribute-lft-neg-in86.9%
distribute-frac-neg86.9%
neg-sub086.9%
associate--r-86.9%
metadata-eval86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in x around inf 66.0%
associate-/l*79.1%
associate-/r/78.9%
Applied egg-rr78.9%
if -4.9999999999999998e-8 < y < 1.8999999999999999Initial program 100.0%
sub-neg100.0%
associate-*l/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.7%
Taylor expanded in y around 0 99.2%
if 1.8999999999999999 < y Initial program 29.4%
sub-neg29.4%
associate-*l/56.3%
distribute-lft-neg-in56.3%
distribute-frac-neg56.3%
neg-sub056.3%
associate--r-56.3%
metadata-eval56.3%
+-commutative56.3%
+-commutative56.3%
Simplified56.3%
Taylor expanded in x around inf 50.7%
Taylor expanded in y around inf 75.5%
neg-mul-175.5%
unsub-neg75.5%
Simplified75.5%
Final simplification89.2%
(FPCore (x y) :precision binary64 (if (or (<= y -420.0) (not (<= y 150000.0))) (+ x (/ (- 1.0 x) y)) (+ 1.0 (* y (/ x (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if ((y <= -420.0) || !(y <= 150000.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 <= (-420.0d0)) .or. (.not. (y <= 150000.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 <= -420.0) || !(y <= 150000.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 <= -420.0) or not (y <= 150000.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 <= -420.0) || !(y <= 150000.0)) tmp = Float64(x + Float64(Float64(1.0 - x) / y)); else tmp = Float64(1.0 + Float64(y * Float64(x / Float64(y + 1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -420.0) || ~((y <= 150000.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, -420.0], N[Not[LessEqual[y, 150000.0]], $MachinePrecision]], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -420 \lor \neg \left(y \leq 150000\right):\\
\;\;\;\;x + \frac{1 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if y < -420 or 1.5e5 < y Initial program 30.6%
Taylor expanded in y around -inf 98.8%
mul-1-neg98.8%
sub-neg98.8%
metadata-eval98.8%
distribute-neg-frac98.8%
+-commutative98.8%
distribute-neg-in98.8%
metadata-eval98.8%
sub-neg98.8%
Simplified98.8%
if -420 < y < 1.5e5Initial program 100.0%
sub-neg100.0%
associate-*l/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.6%
Final simplification99.2%
(FPCore (x y)
:precision binary64
(if (<= y -1.4e+99)
x
(if (<= y -1.1e+46)
(/ 1.0 y)
(if (<= y -1.0) x (if (<= y 9.5e-12) (- 1.0 y) x)))))
double code(double x, double y) {
double tmp;
if (y <= -1.4e+99) {
tmp = x;
} else if (y <= -1.1e+46) {
tmp = 1.0 / y;
} else if (y <= -1.0) {
tmp = x;
} else if (y <= 9.5e-12) {
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.4d+99)) then
tmp = x
else if (y <= (-1.1d+46)) then
tmp = 1.0d0 / y
else if (y <= (-1.0d0)) then
tmp = x
else if (y <= 9.5d-12) 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.4e+99) {
tmp = x;
} else if (y <= -1.1e+46) {
tmp = 1.0 / y;
} else if (y <= -1.0) {
tmp = x;
} else if (y <= 9.5e-12) {
tmp = 1.0 - y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.4e+99: tmp = x elif y <= -1.1e+46: tmp = 1.0 / y elif y <= -1.0: tmp = x elif y <= 9.5e-12: tmp = 1.0 - y else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.4e+99) tmp = x; elseif (y <= -1.1e+46) tmp = Float64(1.0 / y); elseif (y <= -1.0) tmp = x; elseif (y <= 9.5e-12) tmp = Float64(1.0 - y); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.4e+99) tmp = x; elseif (y <= -1.1e+46) tmp = 1.0 / y; elseif (y <= -1.0) tmp = x; elseif (y <= 9.5e-12) tmp = 1.0 - y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.4e+99], x, If[LessEqual[y, -1.1e+46], N[(1.0 / y), $MachinePrecision], If[LessEqual[y, -1.0], x, If[LessEqual[y, 9.5e-12], N[(1.0 - y), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+99}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{+46}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-12}:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.4e99 or -1.1e46 < y < -1 or 9.4999999999999995e-12 < y Initial program 33.2%
sub-neg33.2%
associate-*l/59.2%
distribute-lft-neg-in59.2%
distribute-frac-neg59.2%
neg-sub059.2%
associate--r-59.2%
metadata-eval59.2%
+-commutative59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in y around inf 78.3%
if -1.4e99 < y < -1.1e46Initial program 33.7%
sub-neg33.7%
associate-*l/33.3%
distribute-lft-neg-in33.3%
distribute-frac-neg33.3%
neg-sub033.3%
associate--r-33.3%
metadata-eval33.3%
+-commutative33.3%
+-commutative33.3%
Simplified33.3%
Taylor expanded in x around 0 3.4%
neg-mul-13.4%
sub-neg3.4%
Simplified3.4%
Taylor expanded in y around inf 70.1%
if -1 < y < 9.4999999999999995e-12Initial program 100.0%
sub-neg100.0%
associate-*l/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 74.1%
neg-mul-174.1%
sub-neg74.1%
Simplified74.1%
Taylor expanded in y around 0 74.1%
neg-mul-174.1%
sub-neg74.1%
Simplified74.1%
Final simplification75.7%
(FPCore (x y)
:precision binary64
(if (<= y -1.75e+99)
x
(if (<= y -1.08e+46)
(/ 1.0 y)
(if (<= y -1.0) (* y (/ x y)) (if (<= y 9.5e-12) (- 1.0 y) x)))))
double code(double x, double y) {
double tmp;
if (y <= -1.75e+99) {
tmp = x;
} else if (y <= -1.08e+46) {
tmp = 1.0 / y;
} else if (y <= -1.0) {
tmp = y * (x / y);
} else if (y <= 9.5e-12) {
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.75d+99)) then
tmp = x
else if (y <= (-1.08d+46)) then
tmp = 1.0d0 / y
else if (y <= (-1.0d0)) then
tmp = y * (x / y)
else if (y <= 9.5d-12) 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.75e+99) {
tmp = x;
} else if (y <= -1.08e+46) {
tmp = 1.0 / y;
} else if (y <= -1.0) {
tmp = y * (x / y);
} else if (y <= 9.5e-12) {
tmp = 1.0 - y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.75e+99: tmp = x elif y <= -1.08e+46: tmp = 1.0 / y elif y <= -1.0: tmp = y * (x / y) elif y <= 9.5e-12: tmp = 1.0 - y else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.75e+99) tmp = x; elseif (y <= -1.08e+46) tmp = Float64(1.0 / y); elseif (y <= -1.0) tmp = Float64(y * Float64(x / y)); elseif (y <= 9.5e-12) tmp = Float64(1.0 - y); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.75e+99) tmp = x; elseif (y <= -1.08e+46) tmp = 1.0 / y; elseif (y <= -1.0) tmp = y * (x / y); elseif (y <= 9.5e-12) tmp = 1.0 - y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.75e+99], x, If[LessEqual[y, -1.08e+46], N[(1.0 / y), $MachinePrecision], If[LessEqual[y, -1.0], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e-12], N[(1.0 - y), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+99}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.08 \cdot 10^{+46}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-12}:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.7499999999999999e99 or 9.4999999999999995e-12 < y Initial program 28.9%
sub-neg28.9%
associate-*l/56.2%
distribute-lft-neg-in56.2%
distribute-frac-neg56.2%
neg-sub056.2%
associate--r-56.2%
metadata-eval56.2%
+-commutative56.2%
+-commutative56.2%
Simplified56.2%
Taylor expanded in y around inf 79.1%
if -1.7499999999999999e99 < y < -1.07999999999999994e46Initial program 33.7%
sub-neg33.7%
associate-*l/33.3%
distribute-lft-neg-in33.3%
distribute-frac-neg33.3%
neg-sub033.3%
associate--r-33.3%
metadata-eval33.3%
+-commutative33.3%
+-commutative33.3%
Simplified33.3%
Taylor expanded in x around 0 3.4%
neg-mul-13.4%
sub-neg3.4%
Simplified3.4%
Taylor expanded in y around inf 70.1%
if -1.07999999999999994e46 < y < -1Initial program 70.1%
sub-neg70.1%
associate-*l/84.9%
distribute-lft-neg-in84.9%
distribute-frac-neg84.9%
neg-sub084.9%
associate--r-84.9%
metadata-eval84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
Taylor expanded in x around inf 60.8%
associate-/l*76.0%
associate-/r/75.9%
Applied egg-rr75.9%
Taylor expanded in y around inf 71.6%
if -1 < y < 9.4999999999999995e-12Initial program 100.0%
sub-neg100.0%
associate-*l/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 74.1%
neg-mul-174.1%
sub-neg74.1%
Simplified74.1%
Taylor expanded in y around 0 74.1%
neg-mul-174.1%
sub-neg74.1%
Simplified74.1%
Final simplification75.7%
(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 32.3%
Taylor expanded in y around -inf 97.6%
mul-1-neg97.6%
sub-neg97.6%
metadata-eval97.6%
distribute-neg-frac97.6%
+-commutative97.6%
distribute-neg-in97.6%
metadata-eval97.6%
sub-neg97.6%
Simplified97.6%
if -1 < y < 1.21999999999999997Initial program 100.0%
sub-neg100.0%
associate-*l/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.7%
Taylor expanded in y around 0 98.5%
Final simplification98.1%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 1.0))) (+ x (/ (- 1.0 x) y)) (+ 1.0 (- (* y x) y))))
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) - 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)) .or. (.not. (y <= 1.0d0))) then
tmp = x + ((1.0d0 - x) / y)
else
tmp = 1.0d0 + ((y * x) - y)
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) - y);
}
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) - y) 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(Float64(y * x) - y)); 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) - y); 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[(N[(y * x), $MachinePrecision] - y), $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 + \left(y \cdot x - y\right)\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 32.3%
Taylor expanded in y around -inf 97.6%
mul-1-neg97.6%
sub-neg97.6%
metadata-eval97.6%
distribute-neg-frac97.6%
+-commutative97.6%
distribute-neg-in97.6%
metadata-eval97.6%
sub-neg97.6%
Simplified97.6%
if -1 < y < 1Initial program 100.0%
Taylor expanded in y around 0 98.9%
*-commutative98.9%
/-rgt-identity98.9%
associate-/r/98.8%
div-sub98.8%
remove-double-div98.8%
associate-/r/98.9%
/-rgt-identity98.9%
*-commutative98.9%
Simplified98.9%
Final simplification98.2%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 9.5e-12) (- 1.0 y) x)))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 9.5e-12) {
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 <= 9.5d-12) 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 <= 9.5e-12) {
tmp = 1.0 - y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 9.5e-12: tmp = 1.0 - y else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 9.5e-12) 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 <= 9.5e-12) tmp = 1.0 - y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 9.5e-12], N[(1.0 - y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-12}:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 9.4999999999999995e-12 < y Initial program 33.3%
sub-neg33.3%
associate-*l/56.0%
distribute-lft-neg-in56.0%
distribute-frac-neg56.0%
neg-sub056.0%
associate--r-56.0%
metadata-eval56.0%
+-commutative56.0%
+-commutative56.0%
Simplified56.0%
Taylor expanded in y around inf 72.9%
if -1 < y < 9.4999999999999995e-12Initial program 100.0%
sub-neg100.0%
associate-*l/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 74.1%
neg-mul-174.1%
sub-neg74.1%
Simplified74.1%
Taylor expanded in y around 0 74.1%
neg-mul-174.1%
sub-neg74.1%
Simplified74.1%
Final simplification73.5%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 9.5e-12) 1.0 x)))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 9.5e-12) {
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 <= 9.5d-12) 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 <= 9.5e-12) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 9.5e-12: tmp = 1.0 else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 9.5e-12) 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 <= 9.5e-12) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 9.5e-12], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-12}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 9.4999999999999995e-12 < y Initial program 33.3%
sub-neg33.3%
associate-*l/56.0%
distribute-lft-neg-in56.0%
distribute-frac-neg56.0%
neg-sub056.0%
associate--r-56.0%
metadata-eval56.0%
+-commutative56.0%
+-commutative56.0%
Simplified56.0%
Taylor expanded in y around inf 72.9%
if -1 < y < 9.4999999999999995e-12Initial program 100.0%
sub-neg100.0%
associate-*l/100.0%
distribute-lft-neg-in100.0%
distribute-frac-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 73.8%
Final simplification73.3%
(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.8%
sub-neg65.8%
associate-*l/77.5%
distribute-lft-neg-in77.5%
distribute-frac-neg77.5%
neg-sub077.5%
associate--r-77.5%
metadata-eval77.5%
+-commutative77.5%
+-commutative77.5%
Simplified77.5%
Taylor expanded in y around 0 37.9%
Final simplification37.9%
(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 2023290
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(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))))