
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
(FPCore (x y) :precision binary64 (let* ((t_0 (+ y (+ -2.0 x)))) (- (/ y t_0) (/ x t_0))))
double code(double x, double y) {
double t_0 = y + (-2.0 + x);
return (y / t_0) - (x / t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = y + ((-2.0d0) + x)
code = (y / t_0) - (x / t_0)
end function
public static double code(double x, double y) {
double t_0 = y + (-2.0 + x);
return (y / t_0) - (x / t_0);
}
def code(x, y): t_0 = y + (-2.0 + x) return (y / t_0) - (x / t_0)
function code(x, y) t_0 = Float64(y + Float64(-2.0 + x)) return Float64(Float64(y / t_0) - Float64(x / t_0)) end
function tmp = code(x, y) t_0 = y + (-2.0 + x); tmp = (y / t_0) - (x / t_0); end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(-2.0 + x), $MachinePrecision]), $MachinePrecision]}, N[(N[(y / t$95$0), $MachinePrecision] - N[(x / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(-2 + x\right)\\
\frac{y}{t_0} - \frac{x}{t_0}
\end{array}
\end{array}
Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
div-sub100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (or (<= y -1.35e+111) (not (<= y 3.35e+28))) (- 1.0 (/ (+ x (+ -2.0 x)) y)) (/ (- y x) (- x 2.0))))
double code(double x, double y) {
double tmp;
if ((y <= -1.35e+111) || !(y <= 3.35e+28)) {
tmp = 1.0 - ((x + (-2.0 + x)) / y);
} else {
tmp = (y - x) / (x - 2.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.35d+111)) .or. (.not. (y <= 3.35d+28))) then
tmp = 1.0d0 - ((x + ((-2.0d0) + x)) / y)
else
tmp = (y - x) / (x - 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.35e+111) || !(y <= 3.35e+28)) {
tmp = 1.0 - ((x + (-2.0 + x)) / y);
} else {
tmp = (y - x) / (x - 2.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.35e+111) or not (y <= 3.35e+28): tmp = 1.0 - ((x + (-2.0 + x)) / y) else: tmp = (y - x) / (x - 2.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.35e+111) || !(y <= 3.35e+28)) tmp = Float64(1.0 - Float64(Float64(x + Float64(-2.0 + x)) / y)); else tmp = Float64(Float64(y - x) / Float64(x - 2.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.35e+111) || ~((y <= 3.35e+28))) tmp = 1.0 - ((x + (-2.0 + x)) / y); else tmp = (y - x) / (x - 2.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.35e+111], N[Not[LessEqual[y, 3.35e+28]], $MachinePrecision]], N[(1.0 - N[(N[(x + N[(-2.0 + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+111} \lor \neg \left(y \leq 3.35 \cdot 10^{+28}\right):\\
\;\;\;\;1 - \frac{x + \left(-2 + x\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{x - 2}\\
\end{array}
\end{array}
if y < -1.3499999999999999e111 or 3.35e28 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
div-sub100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
Taylor expanded in y around -inf 85.4%
mul-1-neg85.4%
unsub-neg85.4%
sub-neg85.4%
neg-mul-185.4%
+-commutative85.4%
distribute-neg-in85.4%
remove-double-neg85.4%
metadata-eval85.4%
Simplified85.4%
if -1.3499999999999999e111 < y < 3.35e28Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 92.0%
Final simplification89.3%
(FPCore (x y) :precision binary64 (if (or (<= y -1.35e+111) (not (<= y 2e+26))) (/ (- y x) y) (/ (- y x) (- x 2.0))))
double code(double x, double y) {
double tmp;
if ((y <= -1.35e+111) || !(y <= 2e+26)) {
tmp = (y - x) / y;
} else {
tmp = (y - x) / (x - 2.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.35d+111)) .or. (.not. (y <= 2d+26))) then
tmp = (y - x) / y
else
tmp = (y - x) / (x - 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.35e+111) || !(y <= 2e+26)) {
tmp = (y - x) / y;
} else {
tmp = (y - x) / (x - 2.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.35e+111) or not (y <= 2e+26): tmp = (y - x) / y else: tmp = (y - x) / (x - 2.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.35e+111) || !(y <= 2e+26)) tmp = Float64(Float64(y - x) / y); else tmp = Float64(Float64(y - x) / Float64(x - 2.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.35e+111) || ~((y <= 2e+26))) tmp = (y - x) / y; else tmp = (y - x) / (x - 2.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.35e+111], N[Not[LessEqual[y, 2e+26]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision], N[(N[(y - x), $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+111} \lor \neg \left(y \leq 2 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{x - 2}\\
\end{array}
\end{array}
if y < -1.3499999999999999e111 or 2.0000000000000001e26 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 85.2%
if -1.3499999999999999e111 < y < 2.0000000000000001e26Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 92.0%
Final simplification89.2%
(FPCore (x y) :precision binary64 (if (<= x -2.25e-100) (/ (- x) (+ -2.0 x)) (if (<= x 3.3e+18) (/ y (- y 2.0)) (+ -1.0 (* 2.0 (/ y x))))))
double code(double x, double y) {
double tmp;
if (x <= -2.25e-100) {
tmp = -x / (-2.0 + x);
} else if (x <= 3.3e+18) {
tmp = y / (y - 2.0);
} else {
tmp = -1.0 + (2.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 (x <= (-2.25d-100)) then
tmp = -x / ((-2.0d0) + x)
else if (x <= 3.3d+18) then
tmp = y / (y - 2.0d0)
else
tmp = (-1.0d0) + (2.0d0 * (y / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.25e-100) {
tmp = -x / (-2.0 + x);
} else if (x <= 3.3e+18) {
tmp = y / (y - 2.0);
} else {
tmp = -1.0 + (2.0 * (y / x));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.25e-100: tmp = -x / (-2.0 + x) elif x <= 3.3e+18: tmp = y / (y - 2.0) else: tmp = -1.0 + (2.0 * (y / x)) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.25e-100) tmp = Float64(Float64(-x) / Float64(-2.0 + x)); elseif (x <= 3.3e+18) tmp = Float64(y / Float64(y - 2.0)); else tmp = Float64(-1.0 + Float64(2.0 * Float64(y / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.25e-100) tmp = -x / (-2.0 + x); elseif (x <= 3.3e+18) tmp = y / (y - 2.0); else tmp = -1.0 + (2.0 * (y / x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.25e-100], N[((-x) / N[(-2.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+18], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 + N[(2.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{-100}:\\
\;\;\;\;\frac{-x}{-2 + x}\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+18}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;-1 + 2 \cdot \frac{y}{x}\\
\end{array}
\end{array}
if x < -2.25e-100Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 71.0%
associate-*r/71.0%
mul-1-neg71.0%
sub-neg71.0%
metadata-eval71.0%
Simplified71.0%
if -2.25e-100 < x < 3.3e18Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 80.4%
if 3.3e18 < x Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 84.9%
Simplified84.9%
Taylor expanded in y around inf 84.9%
Final simplification78.3%
(FPCore (x y) :precision binary64 (if (or (<= x -1800000.0) (not (<= x 2.4e+19))) (/ (- y x) x) (/ y (- y 2.0))))
double code(double x, double y) {
double tmp;
if ((x <= -1800000.0) || !(x <= 2.4e+19)) {
tmp = (y - x) / x;
} else {
tmp = y / (y - 2.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-1800000.0d0)) .or. (.not. (x <= 2.4d+19))) then
tmp = (y - x) / x
else
tmp = y / (y - 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -1800000.0) || !(x <= 2.4e+19)) {
tmp = (y - x) / x;
} else {
tmp = y / (y - 2.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -1800000.0) or not (x <= 2.4e+19): tmp = (y - x) / x else: tmp = y / (y - 2.0) return tmp
function code(x, y) tmp = 0.0 if ((x <= -1800000.0) || !(x <= 2.4e+19)) tmp = Float64(Float64(y - x) / x); else tmp = Float64(y / Float64(y - 2.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -1800000.0) || ~((x <= 2.4e+19))) tmp = (y - x) / x; else tmp = y / (y - 2.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -1800000.0], N[Not[LessEqual[x, 2.4e+19]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] / x), $MachinePrecision], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1800000 \lor \neg \left(x \leq 2.4 \cdot 10^{+19}\right):\\
\;\;\;\;\frac{y - x}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y - 2}\\
\end{array}
\end{array}
if x < -1.8e6 or 2.4e19 < x Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 78.6%
if -1.8e6 < x < 2.4e19Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 74.6%
Final simplification76.4%
(FPCore (x y) :precision binary64 (if (<= x -1800000.0) (+ -1.0 (/ -2.0 x)) (if (<= x 1.9e+19) (/ y (- y 2.0)) -1.0)))
double code(double x, double y) {
double tmp;
if (x <= -1800000.0) {
tmp = -1.0 + (-2.0 / x);
} else if (x <= 1.9e+19) {
tmp = y / (y - 2.0);
} else {
tmp = -1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1800000.0d0)) then
tmp = (-1.0d0) + ((-2.0d0) / x)
else if (x <= 1.9d+19) then
tmp = y / (y - 2.0d0)
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1800000.0) {
tmp = -1.0 + (-2.0 / x);
} else if (x <= 1.9e+19) {
tmp = y / (y - 2.0);
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1800000.0: tmp = -1.0 + (-2.0 / x) elif x <= 1.9e+19: tmp = y / (y - 2.0) else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -1800000.0) tmp = Float64(-1.0 + Float64(-2.0 / x)); elseif (x <= 1.9e+19) tmp = Float64(y / Float64(y - 2.0)); else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1800000.0) tmp = -1.0 + (-2.0 / x); elseif (x <= 1.9e+19) tmp = y / (y - 2.0); else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1800000.0], N[(-1.0 + N[(-2.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.9e+19], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], -1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1800000:\\
\;\;\;\;-1 + \frac{-2}{x}\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+19}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -1.8e6Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 75.0%
associate-*r/75.0%
mul-1-neg75.0%
sub-neg75.0%
metadata-eval75.0%
Simplified75.0%
Taylor expanded in x around inf 74.7%
distribute-neg-in74.7%
metadata-eval74.7%
associate-*r/74.7%
metadata-eval74.7%
distribute-neg-frac74.7%
metadata-eval74.7%
Simplified74.7%
if -1.8e6 < x < 1.9e19Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 74.6%
if 1.9e19 < x Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 82.3%
Final simplification76.3%
(FPCore (x y) :precision binary64 (if (<= x -2.15e-100) (/ (- x) (+ -2.0 x)) (if (<= x 2.35e+20) (/ y (- y 2.0)) (/ (- y x) x))))
double code(double x, double y) {
double tmp;
if (x <= -2.15e-100) {
tmp = -x / (-2.0 + x);
} else if (x <= 2.35e+20) {
tmp = y / (y - 2.0);
} else {
tmp = (y - x) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.15d-100)) then
tmp = -x / ((-2.0d0) + x)
else if (x <= 2.35d+20) then
tmp = y / (y - 2.0d0)
else
tmp = (y - x) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.15e-100) {
tmp = -x / (-2.0 + x);
} else if (x <= 2.35e+20) {
tmp = y / (y - 2.0);
} else {
tmp = (y - x) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.15e-100: tmp = -x / (-2.0 + x) elif x <= 2.35e+20: tmp = y / (y - 2.0) else: tmp = (y - x) / x return tmp
function code(x, y) tmp = 0.0 if (x <= -2.15e-100) tmp = Float64(Float64(-x) / Float64(-2.0 + x)); elseif (x <= 2.35e+20) tmp = Float64(y / Float64(y - 2.0)); else tmp = Float64(Float64(y - x) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.15e-100) tmp = -x / (-2.0 + x); elseif (x <= 2.35e+20) tmp = y / (y - 2.0); else tmp = (y - x) / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.15e-100], N[((-x) / N[(-2.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.35e+20], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{-100}:\\
\;\;\;\;\frac{-x}{-2 + x}\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{+20}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{x}\\
\end{array}
\end{array}
if x < -2.14999999999999999e-100Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 71.0%
associate-*r/71.0%
mul-1-neg71.0%
sub-neg71.0%
metadata-eval71.0%
Simplified71.0%
if -2.14999999999999999e-100 < x < 2.35e20Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 80.4%
if 2.35e20 < x Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 83.1%
Final simplification77.9%
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ y x))))
double code(double x, double y) {
return (x - y) / (2.0 - (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (y + x))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (y + x));
}
def code(x, y): return (x - y) / (2.0 - (y + x))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(y + x))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (y + x)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(y + x\right)}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (<= x -2.0) -1.0 (if (<= x -1.85e-100) (* x 0.5) (if (<= x 2.3e+18) 1.0 -1.0))))
double code(double x, double y) {
double tmp;
if (x <= -2.0) {
tmp = -1.0;
} else if (x <= -1.85e-100) {
tmp = x * 0.5;
} else if (x <= 2.3e+18) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.0d0)) then
tmp = -1.0d0
else if (x <= (-1.85d-100)) then
tmp = x * 0.5d0
else if (x <= 2.3d+18) then
tmp = 1.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.0) {
tmp = -1.0;
} else if (x <= -1.85e-100) {
tmp = x * 0.5;
} else if (x <= 2.3e+18) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.0: tmp = -1.0 elif x <= -1.85e-100: tmp = x * 0.5 elif x <= 2.3e+18: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -2.0) tmp = -1.0; elseif (x <= -1.85e-100) tmp = Float64(x * 0.5); elseif (x <= 2.3e+18) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.0) tmp = -1.0; elseif (x <= -1.85e-100) tmp = x * 0.5; elseif (x <= 2.3e+18) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.0], -1.0, If[LessEqual[x, -1.85e-100], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 2.3e+18], 1.0, -1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-100}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+18}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -2 or 2.3e18 < x Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 76.7%
if -2 < x < -1.85000000000000009e-100Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 65.6%
associate-*r/65.6%
mul-1-neg65.6%
sub-neg65.6%
metadata-eval65.6%
Simplified65.6%
Taylor expanded in x around 0 65.0%
*-commutative65.0%
Simplified65.0%
if -1.85000000000000009e-100 < x < 2.3e18Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 58.0%
Final simplification67.0%
(FPCore (x y) :precision binary64 (if (<= x -0.052) (+ -1.0 (/ -2.0 x)) (if (<= x -2.2e-100) (* x 0.5) (if (<= x 3e+19) 1.0 -1.0))))
double code(double x, double y) {
double tmp;
if (x <= -0.052) {
tmp = -1.0 + (-2.0 / x);
} else if (x <= -2.2e-100) {
tmp = x * 0.5;
} else if (x <= 3e+19) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-0.052d0)) then
tmp = (-1.0d0) + ((-2.0d0) / x)
else if (x <= (-2.2d-100)) then
tmp = x * 0.5d0
else if (x <= 3d+19) then
tmp = 1.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.052) {
tmp = -1.0 + (-2.0 / x);
} else if (x <= -2.2e-100) {
tmp = x * 0.5;
} else if (x <= 3e+19) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.052: tmp = -1.0 + (-2.0 / x) elif x <= -2.2e-100: tmp = x * 0.5 elif x <= 3e+19: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -0.052) tmp = Float64(-1.0 + Float64(-2.0 / x)); elseif (x <= -2.2e-100) tmp = Float64(x * 0.5); elseif (x <= 3e+19) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.052) tmp = -1.0 + (-2.0 / x); elseif (x <= -2.2e-100) tmp = x * 0.5; elseif (x <= 3e+19) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.052], N[(-1.0 + N[(-2.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e-100], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 3e+19], 1.0, -1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.052:\\
\;\;\;\;-1 + \frac{-2}{x}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-100}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+19}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -0.0519999999999999976Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 72.7%
associate-*r/72.7%
mul-1-neg72.7%
sub-neg72.7%
metadata-eval72.7%
Simplified72.7%
Taylor expanded in x around inf 72.4%
distribute-neg-in72.4%
metadata-eval72.4%
associate-*r/72.4%
metadata-eval72.4%
distribute-neg-frac72.4%
metadata-eval72.4%
Simplified72.4%
if -0.0519999999999999976 < x < -2.19999999999999989e-100Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 65.6%
associate-*r/65.6%
mul-1-neg65.6%
sub-neg65.6%
metadata-eval65.6%
Simplified65.6%
Taylor expanded in x around 0 65.0%
*-commutative65.0%
Simplified65.0%
if -2.19999999999999989e-100 < x < 3e19Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 58.0%
if 3e19 < x Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 82.3%
Final simplification67.1%
(FPCore (x y) :precision binary64 (if (<= x -2000000.0) -1.0 (if (<= x 1.18e+20) 1.0 -1.0)))
double code(double x, double y) {
double tmp;
if (x <= -2000000.0) {
tmp = -1.0;
} else if (x <= 1.18e+20) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2000000.0d0)) then
tmp = -1.0d0
else if (x <= 1.18d+20) then
tmp = 1.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2000000.0) {
tmp = -1.0;
} else if (x <= 1.18e+20) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2000000.0: tmp = -1.0 elif x <= 1.18e+20: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -2000000.0) tmp = -1.0; elseif (x <= 1.18e+20) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2000000.0) tmp = -1.0; elseif (x <= 1.18e+20) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2000000.0], -1.0, If[LessEqual[x, 1.18e+20], 1.0, -1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2000000:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.18 \cdot 10^{+20}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -2e6 or 1.18e20 < x Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 78.0%
if -2e6 < x < 1.18e20Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 54.9%
Final simplification65.2%
(FPCore (x y) :precision binary64 -1.0)
double code(double x, double y) {
return -1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -1.0d0
end function
public static double code(double x, double y) {
return -1.0;
}
def code(x, y): return -1.0
function code(x, y) return -1.0 end
function tmp = code(x, y) tmp = -1.0; end
code[x_, y_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 36.9%
Final simplification36.9%
(FPCore (x y) :precision binary64 (let* ((t_0 (- 2.0 (+ x y)))) (- (/ x t_0) (/ y t_0))))
double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = 2.0d0 - (x + y)
code = (x / t_0) - (y / t_0)
end function
public static double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
def code(x, y): t_0 = 2.0 - (x + y) return (x / t_0) - (y / t_0)
function code(x, y) t_0 = Float64(2.0 - Float64(x + y)) return Float64(Float64(x / t_0) - Float64(y / t_0)) end
function tmp = code(x, y) t_0 = 2.0 - (x + y); tmp = (x / t_0) - (y / t_0); end
code[x_, y_] := Block[{t$95$0 = N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]}, N[(N[(x / t$95$0), $MachinePrecision] - N[(y / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 - \left(x + y\right)\\
\frac{x}{t_0} - \frac{y}{t_0}
\end{array}
\end{array}
herbie shell --seed 2023310
(FPCore (x y)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, C"
:precision binary64
:herbie-target
(- (/ x (- 2.0 (+ x y))) (/ y (- 2.0 (+ x y))))
(/ (- x y) (- 2.0 (+ x y))))