
(FPCore (x y) :precision binary64 (/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))
double code(double x, double y) {
return ((1.0 - x) * (3.0 - x)) / (y * 3.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((1.0d0 - x) * (3.0d0 - x)) / (y * 3.0d0)
end function
public static double code(double x, double y) {
return ((1.0 - x) * (3.0 - x)) / (y * 3.0);
}
def code(x, y): return ((1.0 - x) * (3.0 - x)) / (y * 3.0)
function code(x, y) return Float64(Float64(Float64(1.0 - x) * Float64(3.0 - x)) / Float64(y * 3.0)) end
function tmp = code(x, y) tmp = ((1.0 - x) * (3.0 - x)) / (y * 3.0); end
code[x_, y_] := N[(N[(N[(1.0 - x), $MachinePrecision] * N[(3.0 - x), $MachinePrecision]), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))
double code(double x, double y) {
return ((1.0 - x) * (3.0 - x)) / (y * 3.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((1.0d0 - x) * (3.0d0 - x)) / (y * 3.0d0)
end function
public static double code(double x, double y) {
return ((1.0 - x) * (3.0 - x)) / (y * 3.0);
}
def code(x, y): return ((1.0 - x) * (3.0 - x)) / (y * 3.0)
function code(x, y) return Float64(Float64(Float64(1.0 - x) * Float64(3.0 - x)) / Float64(y * 3.0)) end
function tmp = code(x, y) tmp = ((1.0 - x) * (3.0 - x)) / (y * 3.0); end
code[x_, y_] := N[(N[(N[(1.0 - x), $MachinePrecision] * N[(3.0 - x), $MachinePrecision]), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
\end{array}
(FPCore (x y) :precision binary64 (let* ((t_0 (* (- 3.0 x) (- 1.0 x)))) (if (<= t_0 2e+98) (/ t_0 (* 3.0 y)) (/ (* x (/ x y)) 3.0))))
double code(double x, double y) {
double t_0 = (3.0 - x) * (1.0 - x);
double tmp;
if (t_0 <= 2e+98) {
tmp = t_0 / (3.0 * y);
} else {
tmp = (x * (x / y)) / 3.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 = (3.0d0 - x) * (1.0d0 - x)
if (t_0 <= 2d+98) then
tmp = t_0 / (3.0d0 * y)
else
tmp = (x * (x / y)) / 3.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (3.0 - x) * (1.0 - x);
double tmp;
if (t_0 <= 2e+98) {
tmp = t_0 / (3.0 * y);
} else {
tmp = (x * (x / y)) / 3.0;
}
return tmp;
}
def code(x, y): t_0 = (3.0 - x) * (1.0 - x) tmp = 0 if t_0 <= 2e+98: tmp = t_0 / (3.0 * y) else: tmp = (x * (x / y)) / 3.0 return tmp
function code(x, y) t_0 = Float64(Float64(3.0 - x) * Float64(1.0 - x)) tmp = 0.0 if (t_0 <= 2e+98) tmp = Float64(t_0 / Float64(3.0 * y)); else tmp = Float64(Float64(x * Float64(x / y)) / 3.0); end return tmp end
function tmp_2 = code(x, y) t_0 = (3.0 - x) * (1.0 - x); tmp = 0.0; if (t_0 <= 2e+98) tmp = t_0 / (3.0 * y); else tmp = (x * (x / y)) / 3.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(3.0 - x), $MachinePrecision] * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+98], N[(t$95$0 / N[(3.0 * y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 - x\right) \cdot \left(1 - x\right)\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{+98}:\\
\;\;\;\;\frac{t\_0}{3 \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{x}{y}}{3}\\
\end{array}
\end{array}
if (*.f64 (-.f64 #s(literal 1 binary64) x) (-.f64 #s(literal 3 binary64) x)) < 2e98Initial program 99.6%
if 2e98 < (*.f64 (-.f64 #s(literal 1 binary64) x) (-.f64 #s(literal 3 binary64) x)) Initial program 90.9%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6490.9%
Simplified90.9%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
Final simplification99.7%
(FPCore (x y)
:precision binary64
(if (<= x -1.75)
(/ (/ (+ x -4.0) y) (/ 3.0 x))
(if (<= x 1.7)
(/ 1.0 (/ y (+ 1.0 (* x -1.3333333333333333))))
(/ (+ x -4.0) (/ (* 3.0 y) x)))))
double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = ((x + -4.0) / y) / (3.0 / x);
} else if (x <= 1.7) {
tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333)));
} else {
tmp = (x + -4.0) / ((3.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 <= (-1.75d0)) then
tmp = ((x + (-4.0d0)) / y) / (3.0d0 / x)
else if (x <= 1.7d0) then
tmp = 1.0d0 / (y / (1.0d0 + (x * (-1.3333333333333333d0))))
else
tmp = (x + (-4.0d0)) / ((3.0d0 * y) / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = ((x + -4.0) / y) / (3.0 / x);
} else if (x <= 1.7) {
tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333)));
} else {
tmp = (x + -4.0) / ((3.0 * y) / x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.75: tmp = ((x + -4.0) / y) / (3.0 / x) elif x <= 1.7: tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333))) else: tmp = (x + -4.0) / ((3.0 * y) / x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.75) tmp = Float64(Float64(Float64(x + -4.0) / y) / Float64(3.0 / x)); elseif (x <= 1.7) tmp = Float64(1.0 / Float64(y / Float64(1.0 + Float64(x * -1.3333333333333333)))); else tmp = Float64(Float64(x + -4.0) / Float64(Float64(3.0 * y) / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.75) tmp = ((x + -4.0) / y) / (3.0 / x); elseif (x <= 1.7) tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333))); else tmp = (x + -4.0) / ((3.0 * y) / x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.75], N[(N[(N[(x + -4.0), $MachinePrecision] / y), $MachinePrecision] / N[(3.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7], N[(1.0 / N[(y / N[(1.0 + N[(x * -1.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -4.0), $MachinePrecision] / N[(N[(3.0 * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;\frac{\frac{x + -4}{y}}{\frac{3}{x}}\\
\mathbf{elif}\;x \leq 1.7:\\
\;\;\;\;\frac{1}{\frac{y}{1 + x \cdot -1.3333333333333333}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + -4}{\frac{3 \cdot y}{x}}\\
\end{array}
\end{array}
if x < -1.75Initial program 93.6%
Taylor expanded in x around inf
sub-negN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
unpow2N/A
associate-/l*N/A
*-rgt-identityN/A
associate-*r/N/A
rgt-mult-inverseN/A
*-rgt-identityN/A
*-lft-identityN/A
unpow2N/A
distribute-rgt-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6492.3%
Simplified92.3%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6498.6%
Applied egg-rr98.6%
if -1.75 < x < 1.69999999999999996Initial program 99.7%
Taylor expanded in x around 0
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6499.5%
Simplified99.5%
un-div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
if 1.69999999999999996 < x Initial program 91.6%
Taylor expanded in x around inf
sub-negN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
unpow2N/A
associate-/l*N/A
*-rgt-identityN/A
associate-*r/N/A
rgt-mult-inverseN/A
*-rgt-identityN/A
*-lft-identityN/A
unpow2N/A
distribute-rgt-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6489.8%
Simplified89.8%
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6497.8%
Applied egg-rr97.8%
(FPCore (x y)
:precision binary64
(if (<= x -1.75)
(* (/ x 3.0) (/ (+ x -4.0) y))
(if (<= x 1.7)
(/ 1.0 (/ y (+ 1.0 (* x -1.3333333333333333))))
(/ (+ x -4.0) (/ (* 3.0 y) x)))))
double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = (x / 3.0) * ((x + -4.0) / y);
} else if (x <= 1.7) {
tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333)));
} else {
tmp = (x + -4.0) / ((3.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 <= (-1.75d0)) then
tmp = (x / 3.0d0) * ((x + (-4.0d0)) / y)
else if (x <= 1.7d0) then
tmp = 1.0d0 / (y / (1.0d0 + (x * (-1.3333333333333333d0))))
else
tmp = (x + (-4.0d0)) / ((3.0d0 * y) / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = (x / 3.0) * ((x + -4.0) / y);
} else if (x <= 1.7) {
tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333)));
} else {
tmp = (x + -4.0) / ((3.0 * y) / x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.75: tmp = (x / 3.0) * ((x + -4.0) / y) elif x <= 1.7: tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333))) else: tmp = (x + -4.0) / ((3.0 * y) / x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.75) tmp = Float64(Float64(x / 3.0) * Float64(Float64(x + -4.0) / y)); elseif (x <= 1.7) tmp = Float64(1.0 / Float64(y / Float64(1.0 + Float64(x * -1.3333333333333333)))); else tmp = Float64(Float64(x + -4.0) / Float64(Float64(3.0 * y) / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.75) tmp = (x / 3.0) * ((x + -4.0) / y); elseif (x <= 1.7) tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333))); else tmp = (x + -4.0) / ((3.0 * y) / x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.75], N[(N[(x / 3.0), $MachinePrecision] * N[(N[(x + -4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7], N[(1.0 / N[(y / N[(1.0 + N[(x * -1.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -4.0), $MachinePrecision] / N[(N[(3.0 * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;\frac{x}{3} \cdot \frac{x + -4}{y}\\
\mathbf{elif}\;x \leq 1.7:\\
\;\;\;\;\frac{1}{\frac{y}{1 + x \cdot -1.3333333333333333}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + -4}{\frac{3 \cdot y}{x}}\\
\end{array}
\end{array}
if x < -1.75Initial program 93.6%
Taylor expanded in x around inf
sub-negN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
unpow2N/A
associate-/l*N/A
*-rgt-identityN/A
associate-*r/N/A
rgt-mult-inverseN/A
*-rgt-identityN/A
*-lft-identityN/A
unpow2N/A
distribute-rgt-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6492.3%
Simplified92.3%
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6498.5%
Applied egg-rr98.5%
if -1.75 < x < 1.69999999999999996Initial program 99.7%
Taylor expanded in x around 0
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6499.5%
Simplified99.5%
un-div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
if 1.69999999999999996 < x Initial program 91.6%
Taylor expanded in x around inf
sub-negN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
unpow2N/A
associate-/l*N/A
*-rgt-identityN/A
associate-*r/N/A
rgt-mult-inverseN/A
*-rgt-identityN/A
*-lft-identityN/A
unpow2N/A
distribute-rgt-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6489.8%
Simplified89.8%
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6497.8%
Applied egg-rr97.8%
Final simplification98.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (/ x 3.0) (/ (+ x -4.0) y))))
(if (<= x -1.75)
t_0
(if (<= x 1.7) (/ 1.0 (/ y (+ 1.0 (* x -1.3333333333333333)))) t_0))))
double code(double x, double y) {
double t_0 = (x / 3.0) * ((x + -4.0) / y);
double tmp;
if (x <= -1.75) {
tmp = t_0;
} else if (x <= 1.7) {
tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (x / 3.0d0) * ((x + (-4.0d0)) / y)
if (x <= (-1.75d0)) then
tmp = t_0
else if (x <= 1.7d0) then
tmp = 1.0d0 / (y / (1.0d0 + (x * (-1.3333333333333333d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x / 3.0) * ((x + -4.0) / y);
double tmp;
if (x <= -1.75) {
tmp = t_0;
} else if (x <= 1.7) {
tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (x / 3.0) * ((x + -4.0) / y) tmp = 0 if x <= -1.75: tmp = t_0 elif x <= 1.7: tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(x / 3.0) * Float64(Float64(x + -4.0) / y)) tmp = 0.0 if (x <= -1.75) tmp = t_0; elseif (x <= 1.7) tmp = Float64(1.0 / Float64(y / Float64(1.0 + Float64(x * -1.3333333333333333)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (x / 3.0) * ((x + -4.0) / y); tmp = 0.0; if (x <= -1.75) tmp = t_0; elseif (x <= 1.7) tmp = 1.0 / (y / (1.0 + (x * -1.3333333333333333))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / 3.0), $MachinePrecision] * N[(N[(x + -4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75], t$95$0, If[LessEqual[x, 1.7], N[(1.0 / N[(y / N[(1.0 + N[(x * -1.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{3} \cdot \frac{x + -4}{y}\\
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.7:\\
\;\;\;\;\frac{1}{\frac{y}{1 + x \cdot -1.3333333333333333}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.75 or 1.69999999999999996 < x Initial program 92.6%
Taylor expanded in x around inf
sub-negN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
unpow2N/A
associate-/l*N/A
*-rgt-identityN/A
associate-*r/N/A
rgt-mult-inverseN/A
*-rgt-identityN/A
*-lft-identityN/A
unpow2N/A
distribute-rgt-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6491.1%
Simplified91.1%
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6498.2%
Applied egg-rr98.2%
if -1.75 < x < 1.69999999999999996Initial program 99.7%
Taylor expanded in x around 0
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6499.5%
Simplified99.5%
un-div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
Final simplification98.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (/ x 3.0) (/ (+ x -4.0) y))))
(if (<= x -1.75)
t_0
(if (<= x 1.7) (/ (+ 1.0 (* x -1.3333333333333333)) y) t_0))))
double code(double x, double y) {
double t_0 = (x / 3.0) * ((x + -4.0) / y);
double tmp;
if (x <= -1.75) {
tmp = t_0;
} else if (x <= 1.7) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (x / 3.0d0) * ((x + (-4.0d0)) / y)
if (x <= (-1.75d0)) then
tmp = t_0
else if (x <= 1.7d0) then
tmp = (1.0d0 + (x * (-1.3333333333333333d0))) / y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x / 3.0) * ((x + -4.0) / y);
double tmp;
if (x <= -1.75) {
tmp = t_0;
} else if (x <= 1.7) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (x / 3.0) * ((x + -4.0) / y) tmp = 0 if x <= -1.75: tmp = t_0 elif x <= 1.7: tmp = (1.0 + (x * -1.3333333333333333)) / y else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(x / 3.0) * Float64(Float64(x + -4.0) / y)) tmp = 0.0 if (x <= -1.75) tmp = t_0; elseif (x <= 1.7) tmp = Float64(Float64(1.0 + Float64(x * -1.3333333333333333)) / y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (x / 3.0) * ((x + -4.0) / y); tmp = 0.0; if (x <= -1.75) tmp = t_0; elseif (x <= 1.7) tmp = (1.0 + (x * -1.3333333333333333)) / y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / 3.0), $MachinePrecision] * N[(N[(x + -4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75], t$95$0, If[LessEqual[x, 1.7], N[(N[(1.0 + N[(x * -1.3333333333333333), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{3} \cdot \frac{x + -4}{y}\\
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.7:\\
\;\;\;\;\frac{1 + x \cdot -1.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.75 or 1.69999999999999996 < x Initial program 92.6%
Taylor expanded in x around inf
sub-negN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
unpow2N/A
associate-/l*N/A
*-rgt-identityN/A
associate-*r/N/A
rgt-mult-inverseN/A
*-rgt-identityN/A
*-lft-identityN/A
unpow2N/A
distribute-rgt-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6491.1%
Simplified91.1%
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6498.2%
Applied egg-rr98.2%
if -1.75 < x < 1.69999999999999996Initial program 99.7%
Taylor expanded in x around 0
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6499.5%
Simplified99.5%
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
Final simplification98.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (/ x y) (+ -1.3333333333333333 (* x 0.3333333333333333)))))
(if (<= x -1.75)
t_0
(if (<= x 1.7) (/ (+ 1.0 (* x -1.3333333333333333)) y) t_0))))
double code(double x, double y) {
double t_0 = (x / y) * (-1.3333333333333333 + (x * 0.3333333333333333));
double tmp;
if (x <= -1.75) {
tmp = t_0;
} else if (x <= 1.7) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (x / y) * ((-1.3333333333333333d0) + (x * 0.3333333333333333d0))
if (x <= (-1.75d0)) then
tmp = t_0
else if (x <= 1.7d0) then
tmp = (1.0d0 + (x * (-1.3333333333333333d0))) / y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x / y) * (-1.3333333333333333 + (x * 0.3333333333333333));
double tmp;
if (x <= -1.75) {
tmp = t_0;
} else if (x <= 1.7) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (x / y) * (-1.3333333333333333 + (x * 0.3333333333333333)) tmp = 0 if x <= -1.75: tmp = t_0 elif x <= 1.7: tmp = (1.0 + (x * -1.3333333333333333)) / y else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(x / y) * Float64(-1.3333333333333333 + Float64(x * 0.3333333333333333))) tmp = 0.0 if (x <= -1.75) tmp = t_0; elseif (x <= 1.7) tmp = Float64(Float64(1.0 + Float64(x * -1.3333333333333333)) / y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (x / y) * (-1.3333333333333333 + (x * 0.3333333333333333)); tmp = 0.0; if (x <= -1.75) tmp = t_0; elseif (x <= 1.7) tmp = (1.0 + (x * -1.3333333333333333)) / y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / y), $MachinePrecision] * N[(-1.3333333333333333 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75], t$95$0, If[LessEqual[x, 1.7], N[(N[(1.0 + N[(x * -1.3333333333333333), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y} \cdot \left(-1.3333333333333333 + x \cdot 0.3333333333333333\right)\\
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.7:\\
\;\;\;\;\frac{1 + x \cdot -1.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.75 or 1.69999999999999996 < x Initial program 92.6%
Taylor expanded in x around inf
sub-negN/A
distribute-rgt-inN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
*-commutativeN/A
times-fracN/A
unpow2N/A
associate-/l*N/A
*-rgt-identityN/A
Simplified98.1%
if -1.75 < x < 1.69999999999999996Initial program 99.7%
Taylor expanded in x around 0
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6499.5%
Simplified99.5%
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
Final simplification98.8%
(FPCore (x y)
:precision binary64
(if (<= x -4.6)
(/ (/ x 3.0) (/ y x))
(if (<= x 3.0)
(/ (+ 1.0 (* x -1.3333333333333333)) y)
(/ (* x (/ x y)) 3.0))))
double code(double x, double y) {
double tmp;
if (x <= -4.6) {
tmp = (x / 3.0) / (y / x);
} else if (x <= 3.0) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = (x * (x / y)) / 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 <= (-4.6d0)) then
tmp = (x / 3.0d0) / (y / x)
else if (x <= 3.0d0) then
tmp = (1.0d0 + (x * (-1.3333333333333333d0))) / y
else
tmp = (x * (x / y)) / 3.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.6) {
tmp = (x / 3.0) / (y / x);
} else if (x <= 3.0) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = (x * (x / y)) / 3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.6: tmp = (x / 3.0) / (y / x) elif x <= 3.0: tmp = (1.0 + (x * -1.3333333333333333)) / y else: tmp = (x * (x / y)) / 3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -4.6) tmp = Float64(Float64(x / 3.0) / Float64(y / x)); elseif (x <= 3.0) tmp = Float64(Float64(1.0 + Float64(x * -1.3333333333333333)) / y); else tmp = Float64(Float64(x * Float64(x / y)) / 3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.6) tmp = (x / 3.0) / (y / x); elseif (x <= 3.0) tmp = (1.0 + (x * -1.3333333333333333)) / y; else tmp = (x * (x / y)) / 3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.6], N[(N[(x / 3.0), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.0], N[(N[(1.0 + N[(x * -1.3333333333333333), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6:\\
\;\;\;\;\frac{\frac{x}{3}}{\frac{y}{x}}\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + x \cdot -1.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{x}{y}}{3}\\
\end{array}
\end{array}
if x < -4.5999999999999996Initial program 93.6%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6489.6%
Simplified89.6%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6495.9%
Applied egg-rr95.9%
if -4.5999999999999996 < x < 3Initial program 99.7%
Taylor expanded in x around 0
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6499.5%
Simplified99.5%
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
if 3 < x Initial program 91.6%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6487.6%
Simplified87.6%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6495.6%
Applied egg-rr95.6%
Final simplification97.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* x (/ x y)) 3.0)))
(if (<= x -4.6)
t_0
(if (<= x 3.0) (/ (+ 1.0 (* x -1.3333333333333333)) y) t_0))))
double code(double x, double y) {
double t_0 = (x * (x / y)) / 3.0;
double tmp;
if (x <= -4.6) {
tmp = t_0;
} else if (x <= 3.0) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (x * (x / y)) / 3.0d0
if (x <= (-4.6d0)) then
tmp = t_0
else if (x <= 3.0d0) then
tmp = (1.0d0 + (x * (-1.3333333333333333d0))) / y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x * (x / y)) / 3.0;
double tmp;
if (x <= -4.6) {
tmp = t_0;
} else if (x <= 3.0) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (x * (x / y)) / 3.0 tmp = 0 if x <= -4.6: tmp = t_0 elif x <= 3.0: tmp = (1.0 + (x * -1.3333333333333333)) / y else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(x * Float64(x / y)) / 3.0) tmp = 0.0 if (x <= -4.6) tmp = t_0; elseif (x <= 3.0) tmp = Float64(Float64(1.0 + Float64(x * -1.3333333333333333)) / y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (x * (x / y)) / 3.0; tmp = 0.0; if (x <= -4.6) tmp = t_0; elseif (x <= 3.0) tmp = (1.0 + (x * -1.3333333333333333)) / y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]}, If[LessEqual[x, -4.6], t$95$0, If[LessEqual[x, 3.0], N[(N[(1.0 + N[(x * -1.3333333333333333), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x \cdot \frac{x}{y}}{3}\\
\mathbf{if}\;x \leq -4.6:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + x \cdot -1.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.5999999999999996 or 3 < x Initial program 92.6%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6488.7%
Simplified88.7%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6495.7%
Applied egg-rr95.7%
if -4.5999999999999996 < x < 3Initial program 99.7%
Taylor expanded in x around 0
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6499.5%
Simplified99.5%
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
Final simplification97.7%
(FPCore (x y) :precision binary64 (let* ((t_0 (/ (* x (/ x y)) 3.0))) (if (<= x -1.75) t_0 (if (<= x 5.2) (/ 1.0 y) t_0))))
double code(double x, double y) {
double t_0 = (x * (x / y)) / 3.0;
double tmp;
if (x <= -1.75) {
tmp = t_0;
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (x * (x / y)) / 3.0d0
if (x <= (-1.75d0)) then
tmp = t_0
else if (x <= 5.2d0) then
tmp = 1.0d0 / y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x * (x / y)) / 3.0;
double tmp;
if (x <= -1.75) {
tmp = t_0;
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (x * (x / y)) / 3.0 tmp = 0 if x <= -1.75: tmp = t_0 elif x <= 5.2: tmp = 1.0 / y else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(x * Float64(x / y)) / 3.0) tmp = 0.0 if (x <= -1.75) tmp = t_0; elseif (x <= 5.2) tmp = Float64(1.0 / y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (x * (x / y)) / 3.0; tmp = 0.0; if (x <= -1.75) tmp = t_0; elseif (x <= 5.2) tmp = 1.0 / y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]}, If[LessEqual[x, -1.75], t$95$0, If[LessEqual[x, 5.2], N[(1.0 / y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x \cdot \frac{x}{y}}{3}\\
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.2:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.75 or 5.20000000000000018 < x Initial program 92.6%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6488.7%
Simplified88.7%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6495.7%
Applied egg-rr95.7%
if -1.75 < x < 5.20000000000000018Initial program 99.7%
Taylor expanded in x around 0
/-lowering-/.f6498.4%
Simplified98.4%
Final simplification97.2%
(FPCore (x y) :precision binary64 (if (<= x -1.75) (* 0.3333333333333333 (/ x (/ y x))) (if (<= x 5.2) (/ 1.0 y) (* x (/ x (/ y 0.3333333333333333))))))
double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = 0.3333333333333333 * (x / (y / x));
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = x * (x / (y / 0.3333333333333333));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.75d0)) then
tmp = 0.3333333333333333d0 * (x / (y / x))
else if (x <= 5.2d0) then
tmp = 1.0d0 / y
else
tmp = x * (x / (y / 0.3333333333333333d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = 0.3333333333333333 * (x / (y / x));
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = x * (x / (y / 0.3333333333333333));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.75: tmp = 0.3333333333333333 * (x / (y / x)) elif x <= 5.2: tmp = 1.0 / y else: tmp = x * (x / (y / 0.3333333333333333)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.75) tmp = Float64(0.3333333333333333 * Float64(x / Float64(y / x))); elseif (x <= 5.2) tmp = Float64(1.0 / y); else tmp = Float64(x * Float64(x / Float64(y / 0.3333333333333333))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.75) tmp = 0.3333333333333333 * (x / (y / x)); elseif (x <= 5.2) tmp = 1.0 / y; else tmp = x * (x / (y / 0.3333333333333333)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.75], N[(0.3333333333333333 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2], N[(1.0 / y), $MachinePrecision], N[(x * N[(x / N[(y / 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;0.3333333333333333 \cdot \frac{x}{\frac{y}{x}}\\
\mathbf{elif}\;x \leq 5.2:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{x}{\frac{y}{0.3333333333333333}}\\
\end{array}
\end{array}
if x < -1.75Initial program 93.6%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6489.6%
Simplified89.6%
associate-/r*N/A
div-invN/A
*-lowering-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval95.7%
Applied egg-rr95.7%
if -1.75 < x < 5.20000000000000018Initial program 99.7%
Taylor expanded in x around 0
/-lowering-/.f6498.4%
Simplified98.4%
if 5.20000000000000018 < x Initial program 91.6%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6487.6%
Simplified87.6%
metadata-evalN/A
div-invN/A
*-commutativeN/A
associate-*l/N/A
*-lowering-*.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6495.5%
Applied egg-rr95.5%
Final simplification97.1%
(FPCore (x y) :precision binary64 (let* ((t_0 (* x (/ x (/ y 0.3333333333333333))))) (if (<= x -1.75) t_0 (if (<= x 5.2) (/ 1.0 y) t_0))))
double code(double x, double y) {
double t_0 = x * (x / (y / 0.3333333333333333));
double tmp;
if (x <= -1.75) {
tmp = t_0;
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x * (x / (y / 0.3333333333333333d0))
if (x <= (-1.75d0)) then
tmp = t_0
else if (x <= 5.2d0) then
tmp = 1.0d0 / y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * (x / (y / 0.3333333333333333));
double tmp;
if (x <= -1.75) {
tmp = t_0;
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (x / (y / 0.3333333333333333)) tmp = 0 if x <= -1.75: tmp = t_0 elif x <= 5.2: tmp = 1.0 / y else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(x / Float64(y / 0.3333333333333333))) tmp = 0.0 if (x <= -1.75) tmp = t_0; elseif (x <= 5.2) tmp = Float64(1.0 / y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (x / (y / 0.3333333333333333)); tmp = 0.0; if (x <= -1.75) tmp = t_0; elseif (x <= 5.2) tmp = 1.0 / y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x / N[(y / 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75], t$95$0, If[LessEqual[x, 5.2], N[(1.0 / y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{x}{\frac{y}{0.3333333333333333}}\\
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.2:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.75 or 5.20000000000000018 < x Initial program 92.6%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6488.6%
Simplified88.6%
metadata-evalN/A
div-invN/A
*-commutativeN/A
associate-*l/N/A
*-lowering-*.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6495.5%
Applied egg-rr95.5%
if -1.75 < x < 5.20000000000000018Initial program 99.7%
Taylor expanded in x around 0
/-lowering-/.f6498.4%
Simplified98.4%
Final simplification97.1%
(FPCore (x y) :precision binary64 (/ (/ (- 3.0 x) y) (/ 3.0 (- 1.0 x))))
double code(double x, double y) {
return ((3.0 - x) / y) / (3.0 / (1.0 - x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((3.0d0 - x) / y) / (3.0d0 / (1.0d0 - x))
end function
public static double code(double x, double y) {
return ((3.0 - x) / y) / (3.0 / (1.0 - x));
}
def code(x, y): return ((3.0 - x) / y) / (3.0 / (1.0 - x))
function code(x, y) return Float64(Float64(Float64(3.0 - x) / y) / Float64(3.0 / Float64(1.0 - x))) end
function tmp = code(x, y) tmp = ((3.0 - x) / y) / (3.0 / (1.0 - x)); end
code[x_, y_] := N[(N[(N[(3.0 - x), $MachinePrecision] / y), $MachinePrecision] / N[(3.0 / N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{3 - x}{y}}{\frac{3}{1 - x}}
\end{array}
Initial program 96.4%
clear-numN/A
*-commutativeN/A
times-fracN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
(FPCore (x y) :precision binary64 (/ (- 0.3333333333333333 (/ x 3.0)) (/ y (- 3.0 x))))
double code(double x, double y) {
return (0.3333333333333333 - (x / 3.0)) / (y / (3.0 - x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (0.3333333333333333d0 - (x / 3.0d0)) / (y / (3.0d0 - x))
end function
public static double code(double x, double y) {
return (0.3333333333333333 - (x / 3.0)) / (y / (3.0 - x));
}
def code(x, y): return (0.3333333333333333 - (x / 3.0)) / (y / (3.0 - x))
function code(x, y) return Float64(Float64(0.3333333333333333 - Float64(x / 3.0)) / Float64(y / Float64(3.0 - x))) end
function tmp = code(x, y) tmp = (0.3333333333333333 - (x / 3.0)) / (y / (3.0 - x)); end
code[x_, y_] := N[(N[(0.3333333333333333 - N[(x / 3.0), $MachinePrecision]), $MachinePrecision] / N[(y / N[(3.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.3333333333333333 - \frac{x}{3}}{\frac{y}{3 - x}}
\end{array}
Initial program 96.4%
clear-numN/A
*-commutativeN/A
times-fracN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
div-subN/A
--lowering--.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
(FPCore (x y) :precision binary64 (if (<= x -0.75) (* (/ x y) -1.3333333333333333) (/ 1.0 y)))
double code(double x, double y) {
double tmp;
if (x <= -0.75) {
tmp = (x / y) * -1.3333333333333333;
} else {
tmp = 1.0 / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-0.75d0)) then
tmp = (x / y) * (-1.3333333333333333d0)
else
tmp = 1.0d0 / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.75) {
tmp = (x / y) * -1.3333333333333333;
} else {
tmp = 1.0 / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.75: tmp = (x / y) * -1.3333333333333333 else: tmp = 1.0 / y return tmp
function code(x, y) tmp = 0.0 if (x <= -0.75) tmp = Float64(Float64(x / y) * -1.3333333333333333); else tmp = Float64(1.0 / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.75) tmp = (x / y) * -1.3333333333333333; else tmp = 1.0 / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.75], N[(N[(x / y), $MachinePrecision] * -1.3333333333333333), $MachinePrecision], N[(1.0 / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.75:\\
\;\;\;\;\frac{x}{y} \cdot -1.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y}\\
\end{array}
\end{array}
if x < -0.75Initial program 93.6%
Taylor expanded in x around 0
*-rgt-identityN/A
rgt-mult-inverseN/A
associate-*r/N/A
*-rgt-identityN/A
associate-/l*N/A
unpow2N/A
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
associate-*r*N/A
Simplified25.0%
Taylor expanded in x around inf
*-lowering-*.f64N/A
/-lowering-/.f6425.0%
Simplified25.0%
if -0.75 < x Initial program 97.3%
Taylor expanded in x around 0
/-lowering-/.f6471.0%
Simplified71.0%
Final simplification59.9%
(FPCore (x y) :precision binary64 (/ 1.0 y))
double code(double x, double y) {
return 1.0 / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / y
end function
public static double code(double x, double y) {
return 1.0 / y;
}
def code(x, y): return 1.0 / y
function code(x, y) return Float64(1.0 / y) end
function tmp = code(x, y) tmp = 1.0 / y; end
code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{y}
\end{array}
Initial program 96.4%
Taylor expanded in x around 0
/-lowering-/.f6455.2%
Simplified55.2%
(FPCore (x y) :precision binary64 (* (/ (- 1.0 x) y) (/ (- 3.0 x) 3.0)))
double code(double x, double y) {
return ((1.0 - x) / y) * ((3.0 - x) / 3.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((1.0d0 - x) / y) * ((3.0d0 - x) / 3.0d0)
end function
public static double code(double x, double y) {
return ((1.0 - x) / y) * ((3.0 - x) / 3.0);
}
def code(x, y): return ((1.0 - x) / y) * ((3.0 - x) / 3.0)
function code(x, y) return Float64(Float64(Float64(1.0 - x) / y) * Float64(Float64(3.0 - x) / 3.0)) end
function tmp = code(x, y) tmp = ((1.0 - x) / y) * ((3.0 - x) / 3.0); end
code[x_, y_] := N[(N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision] * N[(N[(3.0 - x), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 - x}{y} \cdot \frac{3 - x}{3}
\end{array}
herbie shell --seed 2024163
(FPCore (x y)
:name "Diagrams.TwoD.Arc:bezierFromSweepQ1 from diagrams-lib-1.3.0.3"
:precision binary64
:alt
(! :herbie-platform default (* (/ (- 1 x) y) (/ (- 3 x) 3)))
(/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))