
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
Initial program 99.9%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ 1.0 (* y (sqrt x))))) (if (<= y -5.5e+33) t_0 (if (<= y 1.15e+20) (- 1.0 x) t_0))))
double code(double x, double y) {
double t_0 = 1.0 + (y * sqrt(x));
double tmp;
if (y <= -5.5e+33) {
tmp = t_0;
} else if (y <= 1.15e+20) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (y * sqrt(x))
if (y <= (-5.5d+33)) then
tmp = t_0
else if (y <= 1.15d+20) then
tmp = 1.0d0 - x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y * Math.sqrt(x));
double tmp;
if (y <= -5.5e+33) {
tmp = t_0;
} else if (y <= 1.15e+20) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y * math.sqrt(x)) tmp = 0 if y <= -5.5e+33: tmp = t_0 elif y <= 1.15e+20: tmp = 1.0 - x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y * sqrt(x))) tmp = 0.0 if (y <= -5.5e+33) tmp = t_0; elseif (y <= 1.15e+20) tmp = Float64(1.0 - x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y * sqrt(x)); tmp = 0.0; if (y <= -5.5e+33) tmp = t_0; elseif (y <= 1.15e+20) tmp = 1.0 - x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+33], t$95$0, If[LessEqual[y, 1.15e+20], N[(1.0 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + y \cdot \sqrt{x}\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+33}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+20}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -5.5000000000000006e33 or 1.15e20 < y Initial program 99.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6494.0%
Simplified94.0%
if -5.5000000000000006e33 < y < 1.15e20Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f64100.0%
Simplified100.0%
Final simplification97.4%
(FPCore (x y) :precision binary64 (let* ((t_0 (* y (sqrt x)))) (if (<= y -1.45e+46) t_0 (if (<= y 2.9e+44) (- 1.0 x) t_0))))
double code(double x, double y) {
double t_0 = y * sqrt(x);
double tmp;
if (y <= -1.45e+46) {
tmp = t_0;
} else if (y <= 2.9e+44) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y * sqrt(x)
if (y <= (-1.45d+46)) then
tmp = t_0
else if (y <= 2.9d+44) then
tmp = 1.0d0 - x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * Math.sqrt(x);
double tmp;
if (y <= -1.45e+46) {
tmp = t_0;
} else if (y <= 2.9e+44) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = y * math.sqrt(x) tmp = 0 if y <= -1.45e+46: tmp = t_0 elif y <= 2.9e+44: tmp = 1.0 - x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(y * sqrt(x)) tmp = 0.0 if (y <= -1.45e+46) tmp = t_0; elseif (y <= 2.9e+44) tmp = Float64(1.0 - x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = y * sqrt(x); tmp = 0.0; if (y <= -1.45e+46) tmp = t_0; elseif (y <= 2.9e+44) tmp = 1.0 - x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.45e+46], t$95$0, If[LessEqual[y, 2.9e+44], N[(1.0 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x}\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{+46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+44}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.4500000000000001e46 or 2.9000000000000002e44 < y Initial program 99.8%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6491.4%
Simplified91.4%
if -1.4500000000000001e46 < y < 2.9000000000000002e44Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6497.6%
Simplified97.6%
Final simplification95.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (* x x))))
(if (<= y 2.9e+44)
(/ (* (- 1.0 x) y) y)
(/
(/
(+ (- 1.0 x) (* (* x t_0) (+ 1.0 (* x (+ -1.0 (* x (- 1.0 x)))))))
(* (- 1.0 x) (/ (- 1.0 x) t_0)))
(- 1.0 x)))))
double code(double x, double y) {
double t_0 = 1.0 - (x * x);
double tmp;
if (y <= 2.9e+44) {
tmp = ((1.0 - x) * y) / y;
} else {
tmp = (((1.0 - x) + ((x * t_0) * (1.0 + (x * (-1.0 + (x * (1.0 - x))))))) / ((1.0 - x) * ((1.0 - x) / t_0))) / (1.0 - x);
}
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 - (x * x)
if (y <= 2.9d+44) then
tmp = ((1.0d0 - x) * y) / y
else
tmp = (((1.0d0 - x) + ((x * t_0) * (1.0d0 + (x * ((-1.0d0) + (x * (1.0d0 - x))))))) / ((1.0d0 - x) * ((1.0d0 - x) / t_0))) / (1.0d0 - x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (x * x);
double tmp;
if (y <= 2.9e+44) {
tmp = ((1.0 - x) * y) / y;
} else {
tmp = (((1.0 - x) + ((x * t_0) * (1.0 + (x * (-1.0 + (x * (1.0 - x))))))) / ((1.0 - x) * ((1.0 - x) / t_0))) / (1.0 - x);
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (x * x) tmp = 0 if y <= 2.9e+44: tmp = ((1.0 - x) * y) / y else: tmp = (((1.0 - x) + ((x * t_0) * (1.0 + (x * (-1.0 + (x * (1.0 - x))))))) / ((1.0 - x) * ((1.0 - x) / t_0))) / (1.0 - x) return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(x * x)) tmp = 0.0 if (y <= 2.9e+44) tmp = Float64(Float64(Float64(1.0 - x) * y) / y); else tmp = Float64(Float64(Float64(Float64(1.0 - x) + Float64(Float64(x * t_0) * Float64(1.0 + Float64(x * Float64(-1.0 + Float64(x * Float64(1.0 - x))))))) / Float64(Float64(1.0 - x) * Float64(Float64(1.0 - x) / t_0))) / Float64(1.0 - x)); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (x * x); tmp = 0.0; if (y <= 2.9e+44) tmp = ((1.0 - x) * y) / y; else tmp = (((1.0 - x) + ((x * t_0) * (1.0 + (x * (-1.0 + (x * (1.0 - x))))))) / ((1.0 - x) * ((1.0 - x) / t_0))) / (1.0 - x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.9e+44], N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(N[(1.0 - x), $MachinePrecision] + N[(N[(x * t$95$0), $MachinePrecision] * N[(1.0 + N[(x * N[(-1.0 + N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 - x), $MachinePrecision] * N[(N[(1.0 - x), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - x \cdot x\\
\mathbf{if}\;y \leq 2.9 \cdot 10^{+44}:\\
\;\;\;\;\frac{\left(1 - x\right) \cdot y}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(1 - x\right) + \left(x \cdot t\_0\right) \cdot \left(1 + x \cdot \left(-1 + x \cdot \left(1 - x\right)\right)\right)}{\left(1 - x\right) \cdot \frac{1 - x}{t\_0}}}{1 - x}\\
\end{array}
\end{array}
if y < 2.9000000000000002e44Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6475.2%
Simplified75.2%
flip--N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
--lowering--.f64N/A
*-lowering-*.f6454.3%
Applied egg-rr54.3%
clear-numN/A
metadata-evalN/A
+-commutativeN/A
flip--N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l*N/A
div-invN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6475.8%
Applied egg-rr75.8%
if 2.9000000000000002e44 < y Initial program 99.8%
Applied egg-rr16.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f6410.5%
Simplified10.5%
distribute-lft-inN/A
*-rgt-identityN/A
+-commutativeN/A
flip-+N/A
associate-*l/N/A
+-commutativeN/A
flip-+N/A
clear-numN/A
frac-addN/A
/-lowering-/.f64N/A
Applied egg-rr10.2%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6421.3%
Simplified21.3%
Final simplification66.8%
(FPCore (x y) :precision binary64 (if (<= y 2.9e+44) (/ (* (- 1.0 x) y) y) (+ 1.0 (* x (+ 3.0 (* x (* (+ 1.0 x) 4.0)))))))
double code(double x, double y) {
double tmp;
if (y <= 2.9e+44) {
tmp = ((1.0 - x) * y) / y;
} else {
tmp = 1.0 + (x * (3.0 + (x * ((1.0 + x) * 4.0))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.9d+44) then
tmp = ((1.0d0 - x) * y) / y
else
tmp = 1.0d0 + (x * (3.0d0 + (x * ((1.0d0 + x) * 4.0d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.9e+44) {
tmp = ((1.0 - x) * y) / y;
} else {
tmp = 1.0 + (x * (3.0 + (x * ((1.0 + x) * 4.0))));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.9e+44: tmp = ((1.0 - x) * y) / y else: tmp = 1.0 + (x * (3.0 + (x * ((1.0 + x) * 4.0)))) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.9e+44) tmp = Float64(Float64(Float64(1.0 - x) * y) / y); else tmp = Float64(1.0 + Float64(x * Float64(3.0 + Float64(x * Float64(Float64(1.0 + x) * 4.0))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.9e+44) tmp = ((1.0 - x) * y) / y; else tmp = 1.0 + (x * (3.0 + (x * ((1.0 + x) * 4.0)))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.9e+44], N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / y), $MachinePrecision], N[(1.0 + N[(x * N[(3.0 + N[(x * N[(N[(1.0 + x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.9 \cdot 10^{+44}:\\
\;\;\;\;\frac{\left(1 - x\right) \cdot y}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(3 + x \cdot \left(\left(1 + x\right) \cdot 4\right)\right)\\
\end{array}
\end{array}
if y < 2.9000000000000002e44Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6475.2%
Simplified75.2%
flip--N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
--lowering--.f64N/A
*-lowering-*.f6454.3%
Applied egg-rr54.3%
clear-numN/A
metadata-evalN/A
+-commutativeN/A
flip--N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l*N/A
div-invN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6475.8%
Applied egg-rr75.8%
if 2.9000000000000002e44 < y Initial program 99.8%
Applied egg-rr16.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f6410.5%
Simplified10.5%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6421.2%
Simplified21.2%
Final simplification66.8%
(FPCore (x y) :precision binary64 (if (<= x 1.0) 1.0 (- 0.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = 0.0 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.0d0) then
tmp = 1.0d0
else
tmp = 0.0d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = 0.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.0: tmp = 1.0 else: tmp = 0.0 - x return tmp
function code(x, y) tmp = 0.0 if (x <= 1.0) tmp = 1.0; else tmp = Float64(0.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.0) tmp = 1.0; else tmp = 0.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.0], 1.0, N[(0.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0 - x\\
\end{array}
\end{array}
if x < 1Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6459.6%
Simplified59.6%
Taylor expanded in x around 0
Simplified58.3%
if 1 < x Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6469.6%
Simplified69.6%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6467.8%
Simplified67.8%
(FPCore (x y) :precision binary64 (if (<= x 1.0) 1.0 (- -3.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = -3.0 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.0d0) then
tmp = 1.0d0
else
tmp = (-3.0d0) - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = -3.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.0: tmp = 1.0 else: tmp = -3.0 - x return tmp
function code(x, y) tmp = 0.0 if (x <= 1.0) tmp = 1.0; else tmp = Float64(-3.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.0) tmp = 1.0; else tmp = -3.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.0], 1.0, N[(-3.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-3 - x\\
\end{array}
\end{array}
if x < 1Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6459.6%
Simplified59.6%
Taylor expanded in x around 0
Simplified58.3%
if 1 < x Initial program 99.9%
Applied egg-rr18.5%
Taylor expanded in y around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f6434.0%
Simplified34.0%
Taylor expanded in x around inf
associate-*r*N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
mul-1-negN/A
unsub-negN/A
mul-1-negN/A
distribute-rgt-neg-outN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
--lowering--.f64N/A
metadata-eval67.7%
Simplified67.7%
(FPCore (x y) :precision binary64 (/ (* (- 1.0 x) y) y))
double code(double x, double y) {
return ((1.0 - x) * y) / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((1.0d0 - x) * y) / y
end function
public static double code(double x, double y) {
return ((1.0 - x) * y) / y;
}
def code(x, y): return ((1.0 - x) * y) / y
function code(x, y) return Float64(Float64(Float64(1.0 - x) * y) / y) end
function tmp = code(x, y) tmp = ((1.0 - x) * y) / y; end
code[x_, y_] := N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 - x\right) \cdot y}{y}
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6464.8%
Simplified64.8%
flip--N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
--lowering--.f64N/A
*-lowering-*.f6447.1%
Applied egg-rr47.1%
clear-numN/A
metadata-evalN/A
+-commutativeN/A
flip--N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l*N/A
div-invN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6465.0%
Applied egg-rr65.0%
(FPCore (x y) :precision binary64 (if (<= x 1.0) 1.0 -3.0))
double code(double x, double y) {
double tmp;
if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.0d0) then
tmp = 1.0d0
else
tmp = -3.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.0: tmp = 1.0 else: tmp = -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 1.0) tmp = 1.0; else tmp = -3.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.0) tmp = 1.0; else tmp = -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.0], 1.0, -3.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-3\\
\end{array}
\end{array}
if x < 1Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6459.6%
Simplified59.6%
Taylor expanded in x around 0
Simplified58.3%
if 1 < x Initial program 99.9%
Applied egg-rr18.5%
Taylor expanded in y around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f6434.0%
Simplified34.0%
Taylor expanded in x around inf
associate-*r*N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
mul-1-negN/A
unsub-negN/A
mul-1-negN/A
distribute-rgt-neg-outN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
--lowering--.f64N/A
metadata-eval67.7%
Simplified67.7%
Taylor expanded in x around 0
Simplified4.7%
(FPCore (x y) :precision binary64 (- 1.0 x))
double code(double x, double y) {
return 1.0 - x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - x
end function
public static double code(double x, double y) {
return 1.0 - x;
}
def code(x, y): return 1.0 - x
function code(x, y) return Float64(1.0 - x) end
function tmp = code(x, y) tmp = 1.0 - x; end
code[x_, y_] := N[(1.0 - x), $MachinePrecision]
\begin{array}{l}
\\
1 - x
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6464.8%
Simplified64.8%
(FPCore (x y) :precision binary64 -3.0)
double code(double x, double y) {
return -3.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -3.0d0
end function
public static double code(double x, double y) {
return -3.0;
}
def code(x, y): return -3.0
function code(x, y) return -3.0 end
function tmp = code(x, y) tmp = -3.0; end
code[x_, y_] := -3.0
\begin{array}{l}
\\
-3
\end{array}
Initial program 99.9%
Applied egg-rr40.7%
Taylor expanded in y around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f6445.5%
Simplified45.5%
Taylor expanded in x around inf
associate-*r*N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
mul-1-negN/A
unsub-negN/A
mul-1-negN/A
distribute-rgt-neg-outN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
--lowering--.f64N/A
metadata-eval36.7%
Simplified36.7%
Taylor expanded in x around 0
Simplified3.7%
herbie shell --seed 2024191
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E"
:precision binary64
(+ (- 1.0 x) (* y (sqrt x))))