
(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 14 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 1e+124) (/ t_0 (* 3.0 y)) (/ x (* y (/ 3.0 x))))))
double code(double x, double y) {
double t_0 = (3.0 - x) * (1.0 - x);
double tmp;
if (t_0 <= 1e+124) {
tmp = t_0 / (3.0 * y);
} else {
tmp = x / (y * (3.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 = (3.0d0 - x) * (1.0d0 - x)
if (t_0 <= 1d+124) then
tmp = t_0 / (3.0d0 * y)
else
tmp = x / (y * (3.0d0 / x))
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 <= 1e+124) {
tmp = t_0 / (3.0 * y);
} else {
tmp = x / (y * (3.0 / x));
}
return tmp;
}
def code(x, y): t_0 = (3.0 - x) * (1.0 - x) tmp = 0 if t_0 <= 1e+124: tmp = t_0 / (3.0 * y) else: tmp = x / (y * (3.0 / x)) return tmp
function code(x, y) t_0 = Float64(Float64(3.0 - x) * Float64(1.0 - x)) tmp = 0.0 if (t_0 <= 1e+124) tmp = Float64(t_0 / Float64(3.0 * y)); else tmp = Float64(x / Float64(y * Float64(3.0 / x))); end return tmp end
function tmp_2 = code(x, y) t_0 = (3.0 - x) * (1.0 - x); tmp = 0.0; if (t_0 <= 1e+124) tmp = t_0 / (3.0 * y); else tmp = x / (y * (3.0 / x)); 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, 1e+124], N[(t$95$0 / N[(3.0 * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(3.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 - x\right) \cdot \left(1 - x\right)\\
\mathbf{if}\;t\_0 \leq 10^{+124}:\\
\;\;\;\;\frac{t\_0}{3 \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \frac{3}{x}}\\
\end{array}
\end{array}
if (*.f64 (-.f64 #s(literal 1 binary64) x) (-.f64 #s(literal 3 binary64) x)) < 9.99999999999999948e123Initial program 99.6%
if 9.99999999999999948e123 < (*.f64 (-.f64 #s(literal 1 binary64) x) (-.f64 #s(literal 3 binary64) x)) Initial program 89.8%
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
*-commutativeN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6499.8%
Simplified99.8%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
remove-double-negN/A
neg-mul-1N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
frac-2negN/A
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
frac-2negN/A
associate-/r/N/A
metadata-evalN/A
metadata-evalN/A
neg-mul-1N/A
remove-double-neg99.9%
Applied egg-rr99.9%
Final simplification99.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ x y) (/ 3.0 (+ x -4.0)))))
(if (<= x -1.7)
t_0
(if (<= x 1.75) (/ (+ 1.0 (* x -1.3333333333333333)) y) t_0))))
double code(double x, double y) {
double t_0 = (x / y) / (3.0 / (x + -4.0));
double tmp;
if (x <= -1.7) {
tmp = t_0;
} else if (x <= 1.75) {
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) / (3.0d0 / (x + (-4.0d0)))
if (x <= (-1.7d0)) then
tmp = t_0
else if (x <= 1.75d0) 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) / (3.0 / (x + -4.0));
double tmp;
if (x <= -1.7) {
tmp = t_0;
} else if (x <= 1.75) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (x / y) / (3.0 / (x + -4.0)) tmp = 0 if x <= -1.7: tmp = t_0 elif x <= 1.75: tmp = (1.0 + (x * -1.3333333333333333)) / y else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(x / y) / Float64(3.0 / Float64(x + -4.0))) tmp = 0.0 if (x <= -1.7) tmp = t_0; elseif (x <= 1.75) 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) / (3.0 / (x + -4.0)); tmp = 0.0; if (x <= -1.7) tmp = t_0; elseif (x <= 1.75) 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[(3.0 / N[(x + -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7], t$95$0, If[LessEqual[x, 1.75], N[(N[(1.0 + N[(x * -1.3333333333333333), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{x}{y}}{\frac{3}{x + -4}}\\
\mathbf{if}\;x \leq -1.7:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.75:\\
\;\;\;\;\frac{1 + x \cdot -1.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.69999999999999996 or 1.75 < x Initial program 91.7%
Taylor expanded in x around inf
sub-negN/A
distribute-rgt-inN/A
*-lft-identityN/A
unpow2N/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
distribute-rgt-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6489.1%
Simplified89.1%
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.1%
Applied egg-rr97.1%
if -1.69999999999999996 < x < 1.75Initial program 99.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/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-/.f64100.0%
Simplified100.0%
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (/ x y) (+ -1.3333333333333333 (* x 0.3333333333333333)))))
(if (<= x -1.7)
t_0
(if (<= x 1.75) (/ (+ 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.7) {
tmp = t_0;
} else if (x <= 1.75) {
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.7d0)) then
tmp = t_0
else if (x <= 1.75d0) 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.7) {
tmp = t_0;
} else if (x <= 1.75) {
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.7: tmp = t_0 elif x <= 1.75: 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.7) tmp = t_0; elseif (x <= 1.75) 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.7) tmp = t_0; elseif (x <= 1.75) 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.7], t$95$0, If[LessEqual[x, 1.75], 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.7:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.75:\\
\;\;\;\;\frac{1 + x \cdot -1.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.69999999999999996 or 1.75 < x Initial program 91.7%
Taylor expanded in x around inf
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
times-fracN/A
Simplified97.1%
if -1.69999999999999996 < x < 1.75Initial program 99.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/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-/.f64100.0%
Simplified100.0%
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
Final simplification98.6%
(FPCore (x y)
:precision binary64
(if (<= x -4.6)
(/ (/ x (/ y x)) 3.0)
(if (<= x 3.0)
(/ (+ 1.0 (* x -1.3333333333333333)) y)
(/ x (/ y (/ x 3.0))))))
double code(double x, double y) {
double tmp;
if (x <= -4.6) {
tmp = (x / (y / x)) / 3.0;
} else if (x <= 3.0) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = x / (y / (x / 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 / (y / x)) / 3.0d0
else if (x <= 3.0d0) then
tmp = (1.0d0 + (x * (-1.3333333333333333d0))) / y
else
tmp = x / (y / (x / 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.6) {
tmp = (x / (y / x)) / 3.0;
} else if (x <= 3.0) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = x / (y / (x / 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.6: tmp = (x / (y / x)) / 3.0 elif x <= 3.0: tmp = (1.0 + (x * -1.3333333333333333)) / y else: tmp = x / (y / (x / 3.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.6) tmp = Float64(Float64(x / Float64(y / x)) / 3.0); elseif (x <= 3.0) tmp = Float64(Float64(1.0 + Float64(x * -1.3333333333333333)) / y); else tmp = Float64(x / Float64(y / Float64(x / 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.6) tmp = (x / (y / x)) / 3.0; elseif (x <= 3.0) tmp = (1.0 + (x * -1.3333333333333333)) / y; else tmp = x / (y / (x / 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.6], N[(N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision], If[LessEqual[x, 3.0], N[(N[(1.0 + N[(x * -1.3333333333333333), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(y / N[(x / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6:\\
\;\;\;\;\frac{\frac{x}{\frac{y}{x}}}{3}\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + x \cdot -1.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{\frac{x}{3}}}\\
\end{array}
\end{array}
if x < -4.5999999999999996Initial program 93.0%
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
*-commutativeN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.3%
Simplified96.3%
associate-*l/N/A
associate-*r*N/A
associate-/l*N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6496.4%
Applied egg-rr96.4%
if -4.5999999999999996 < x < 3Initial program 99.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/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-/.f64100.0%
Simplified100.0%
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
if 3 < x Initial program 90.3%
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in x around inf
*-commutativeN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6494.9%
Simplified94.9%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6495.0%
Applied egg-rr95.0%
(FPCore (x y)
:precision binary64
(if (<= x -4.6)
(* x (/ (/ x y) 3.0))
(if (<= x 3.0)
(/ (+ 1.0 (* x -1.3333333333333333)) y)
(/ x (/ y (/ x 3.0))))))
double code(double x, double y) {
double tmp;
if (x <= -4.6) {
tmp = x * ((x / y) / 3.0);
} else if (x <= 3.0) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = x / (y / (x / 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 * ((x / y) / 3.0d0)
else if (x <= 3.0d0) then
tmp = (1.0d0 + (x * (-1.3333333333333333d0))) / y
else
tmp = x / (y / (x / 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.6) {
tmp = x * ((x / y) / 3.0);
} else if (x <= 3.0) {
tmp = (1.0 + (x * -1.3333333333333333)) / y;
} else {
tmp = x / (y / (x / 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.6: tmp = x * ((x / y) / 3.0) elif x <= 3.0: tmp = (1.0 + (x * -1.3333333333333333)) / y else: tmp = x / (y / (x / 3.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.6) tmp = Float64(x * Float64(Float64(x / y) / 3.0)); elseif (x <= 3.0) tmp = Float64(Float64(1.0 + Float64(x * -1.3333333333333333)) / y); else tmp = Float64(x / Float64(y / Float64(x / 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.6) tmp = x * ((x / y) / 3.0); elseif (x <= 3.0) tmp = (1.0 + (x * -1.3333333333333333)) / y; else tmp = x / (y / (x / 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.6], N[(x * N[(N[(x / y), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.0], N[(N[(1.0 + N[(x * -1.3333333333333333), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(y / N[(x / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6:\\
\;\;\;\;x \cdot \frac{\frac{x}{y}}{3}\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + x \cdot -1.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{\frac{x}{3}}}\\
\end{array}
\end{array}
if x < -4.5999999999999996Initial program 93.0%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.4%
Simplified89.4%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-*r*N/A
times-fracN/A
*-lft-identityN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6496.2%
Applied egg-rr96.2%
div-invN/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6496.4%
Applied egg-rr96.4%
if -4.5999999999999996 < x < 3Initial program 99.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/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-/.f64100.0%
Simplified100.0%
un-div-invN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
if 3 < x Initial program 90.3%
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in x around inf
*-commutativeN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6494.9%
Simplified94.9%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6495.0%
Applied egg-rr95.0%
Final simplification97.9%
(FPCore (x y) :precision binary64 (if (<= x -1.7) (* x (/ (/ x y) 3.0)) (if (<= x 5.2) (/ 1.0 y) (/ x (/ y (/ x 3.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.7) {
tmp = x * ((x / y) / 3.0);
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = x / (y / (x / 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.7d0)) then
tmp = x * ((x / y) / 3.0d0)
else if (x <= 5.2d0) then
tmp = 1.0d0 / y
else
tmp = x / (y / (x / 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.7) {
tmp = x * ((x / y) / 3.0);
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = x / (y / (x / 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.7: tmp = x * ((x / y) / 3.0) elif x <= 5.2: tmp = 1.0 / y else: tmp = x / (y / (x / 3.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.7) tmp = Float64(x * Float64(Float64(x / y) / 3.0)); elseif (x <= 5.2) tmp = Float64(1.0 / y); else tmp = Float64(x / Float64(y / Float64(x / 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.7) tmp = x * ((x / y) / 3.0); elseif (x <= 5.2) tmp = 1.0 / y; else tmp = x / (y / (x / 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.7], N[(x * N[(N[(x / y), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2], N[(1.0 / y), $MachinePrecision], N[(x / N[(y / N[(x / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7:\\
\;\;\;\;x \cdot \frac{\frac{x}{y}}{3}\\
\mathbf{elif}\;x \leq 5.2:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{\frac{x}{3}}}\\
\end{array}
\end{array}
if x < -1.69999999999999996Initial program 93.0%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.4%
Simplified89.4%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-*r*N/A
times-fracN/A
*-lft-identityN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6496.2%
Applied egg-rr96.2%
div-invN/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6496.4%
Applied egg-rr96.4%
if -1.69999999999999996 < x < 5.20000000000000018Initial program 99.6%
Taylor expanded in x around 0
/-lowering-/.f6499.2%
Simplified99.2%
if 5.20000000000000018 < x Initial program 90.2%
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in x around inf
*-commutativeN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.2%
Simplified96.2%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6496.3%
Applied egg-rr96.3%
Final simplification97.8%
(FPCore (x y) :precision binary64 (if (<= x -1.7) (* x (/ (/ x y) 3.0)) (if (<= x 5.2) (/ 1.0 y) (/ x (* y (/ 3.0 x))))))
double code(double x, double y) {
double tmp;
if (x <= -1.7) {
tmp = x * ((x / y) / 3.0);
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = x / (y * (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.7d0)) then
tmp = x * ((x / y) / 3.0d0)
else if (x <= 5.2d0) then
tmp = 1.0d0 / y
else
tmp = x / (y * (3.0d0 / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.7) {
tmp = x * ((x / y) / 3.0);
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = x / (y * (3.0 / x));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.7: tmp = x * ((x / y) / 3.0) elif x <= 5.2: tmp = 1.0 / y else: tmp = x / (y * (3.0 / x)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.7) tmp = Float64(x * Float64(Float64(x / y) / 3.0)); elseif (x <= 5.2) tmp = Float64(1.0 / y); else tmp = Float64(x / Float64(y * Float64(3.0 / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.7) tmp = x * ((x / y) / 3.0); elseif (x <= 5.2) tmp = 1.0 / y; else tmp = x / (y * (3.0 / x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.7], N[(x * N[(N[(x / y), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2], N[(1.0 / y), $MachinePrecision], N[(x / N[(y * N[(3.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7:\\
\;\;\;\;x \cdot \frac{\frac{x}{y}}{3}\\
\mathbf{elif}\;x \leq 5.2:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \frac{3}{x}}\\
\end{array}
\end{array}
if x < -1.69999999999999996Initial program 93.0%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.4%
Simplified89.4%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-*r*N/A
times-fracN/A
*-lft-identityN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6496.2%
Applied egg-rr96.2%
div-invN/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6496.4%
Applied egg-rr96.4%
if -1.69999999999999996 < x < 5.20000000000000018Initial program 99.6%
Taylor expanded in x around 0
/-lowering-/.f6499.2%
Simplified99.2%
if 5.20000000000000018 < x Initial program 90.2%
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in x around inf
*-commutativeN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.2%
Simplified96.2%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6496.3%
Applied egg-rr96.3%
remove-double-negN/A
neg-mul-1N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
frac-2negN/A
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
frac-2negN/A
associate-/r/N/A
metadata-evalN/A
metadata-evalN/A
neg-mul-1N/A
remove-double-neg96.3%
Applied egg-rr96.3%
Final simplification97.8%
(FPCore (x y) :precision binary64 (if (<= x -1.7) (* x (/ (/ x y) 3.0)) (if (<= x 5.2) (/ 1.0 y) (* x (/ x (/ y 0.3333333333333333))))))
double code(double x, double y) {
double tmp;
if (x <= -1.7) {
tmp = x * ((x / y) / 3.0);
} 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.7d0)) then
tmp = x * ((x / y) / 3.0d0)
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.7) {
tmp = x * ((x / y) / 3.0);
} 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.7: tmp = x * ((x / y) / 3.0) 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.7) tmp = Float64(x * Float64(Float64(x / y) / 3.0)); 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.7) tmp = x * ((x / y) / 3.0); 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.7], N[(x * N[(N[(x / y), $MachinePrecision] / 3.0), $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.7:\\
\;\;\;\;x \cdot \frac{\frac{x}{y}}{3}\\
\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.69999999999999996Initial program 93.0%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.4%
Simplified89.4%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-*r*N/A
times-fracN/A
*-lft-identityN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6496.2%
Applied egg-rr96.2%
div-invN/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6496.4%
Applied egg-rr96.4%
if -1.69999999999999996 < x < 5.20000000000000018Initial program 99.6%
Taylor expanded in x around 0
/-lowering-/.f6499.2%
Simplified99.2%
if 5.20000000000000018 < x Initial program 90.2%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.7%
Simplified86.7%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-*r*N/A
times-fracN/A
*-lft-identityN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6496.2%
Applied egg-rr96.2%
Final simplification97.8%
(FPCore (x y) :precision binary64 (if (<= x -1.7) (* x (/ (* x 0.3333333333333333) y)) (if (<= x 5.2) (/ 1.0 y) (* x (/ x (/ y 0.3333333333333333))))))
double code(double x, double y) {
double tmp;
if (x <= -1.7) {
tmp = x * ((x * 0.3333333333333333) / y);
} 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.7d0)) then
tmp = x * ((x * 0.3333333333333333d0) / y)
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.7) {
tmp = x * ((x * 0.3333333333333333) / y);
} 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.7: tmp = x * ((x * 0.3333333333333333) / y) 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.7) tmp = Float64(x * Float64(Float64(x * 0.3333333333333333) / y)); 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.7) tmp = x * ((x * 0.3333333333333333) / y); 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.7], N[(x * N[(N[(x * 0.3333333333333333), $MachinePrecision] / y), $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.7:\\
\;\;\;\;x \cdot \frac{x \cdot 0.3333333333333333}{y}\\
\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.69999999999999996Initial program 93.0%
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
*-commutativeN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.3%
Simplified96.3%
if -1.69999999999999996 < x < 5.20000000000000018Initial program 99.6%
Taylor expanded in x around 0
/-lowering-/.f6499.2%
Simplified99.2%
if 5.20000000000000018 < x Initial program 90.2%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.7%
Simplified86.7%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-*r*N/A
times-fracN/A
*-lft-identityN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6496.2%
Applied egg-rr96.2%
Final simplification97.8%
(FPCore (x y) :precision binary64 (if (<= x -1.7) (* x (/ (* x 0.3333333333333333) y)) (if (<= x 5.2) (/ 1.0 y) (* (/ x y) (/ x 3.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1.7) {
tmp = x * ((x * 0.3333333333333333) / y);
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = (x / y) * (x / 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.7d0)) then
tmp = x * ((x * 0.3333333333333333d0) / y)
else if (x <= 5.2d0) then
tmp = 1.0d0 / y
else
tmp = (x / y) * (x / 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.7) {
tmp = x * ((x * 0.3333333333333333) / y);
} else if (x <= 5.2) {
tmp = 1.0 / y;
} else {
tmp = (x / y) * (x / 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.7: tmp = x * ((x * 0.3333333333333333) / y) elif x <= 5.2: tmp = 1.0 / y else: tmp = (x / y) * (x / 3.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.7) tmp = Float64(x * Float64(Float64(x * 0.3333333333333333) / y)); elseif (x <= 5.2) tmp = Float64(1.0 / y); else tmp = Float64(Float64(x / y) * Float64(x / 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.7) tmp = x * ((x * 0.3333333333333333) / y); elseif (x <= 5.2) tmp = 1.0 / y; else tmp = (x / y) * (x / 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.7], N[(x * N[(N[(x * 0.3333333333333333), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2], N[(1.0 / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(x / 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7:\\
\;\;\;\;x \cdot \frac{x \cdot 0.3333333333333333}{y}\\
\mathbf{elif}\;x \leq 5.2:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{3}\\
\end{array}
\end{array}
if x < -1.69999999999999996Initial program 93.0%
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
*-commutativeN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.3%
Simplified96.3%
if -1.69999999999999996 < x < 5.20000000000000018Initial program 99.6%
Taylor expanded in x around 0
/-lowering-/.f6499.2%
Simplified99.2%
if 5.20000000000000018 < x Initial program 90.2%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.7%
Simplified86.7%
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6496.2%
Applied egg-rr96.2%
Final simplification97.8%
(FPCore (x y) :precision binary64 (let* ((t_0 (* x (/ (* x 0.3333333333333333) y)))) (if (<= x -1.7) t_0 (if (<= x 5.2) (/ 1.0 y) t_0))))
double code(double x, double y) {
double t_0 = x * ((x * 0.3333333333333333) / y);
double tmp;
if (x <= -1.7) {
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 * 0.3333333333333333d0) / y)
if (x <= (-1.7d0)) 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 * 0.3333333333333333) / y);
double tmp;
if (x <= -1.7) {
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 * 0.3333333333333333) / y) tmp = 0 if x <= -1.7: 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(Float64(x * 0.3333333333333333) / y)) tmp = 0.0 if (x <= -1.7) 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 * 0.3333333333333333) / y); tmp = 0.0; if (x <= -1.7) 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[(N[(x * 0.3333333333333333), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7], 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 \cdot 0.3333333333333333}{y}\\
\mathbf{if}\;x \leq -1.7:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.2:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.69999999999999996 or 5.20000000000000018 < x Initial program 91.7%
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in x around inf
*-commutativeN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6496.3%
Simplified96.3%
if -1.69999999999999996 < x < 5.20000000000000018Initial program 99.6%
Taylor expanded in x around 0
/-lowering-/.f6499.2%
Simplified99.2%
(FPCore (x y) :precision binary64 (/ (- 3.0 x) (* 3.0 (/ y (- 1.0 x)))))
double code(double x, double y) {
return (3.0 - x) / (3.0 * (y / (1.0 - x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (3.0d0 - x) / (3.0d0 * (y / (1.0d0 - x)))
end function
public static double code(double x, double y) {
return (3.0 - x) / (3.0 * (y / (1.0 - x)));
}
def code(x, y): return (3.0 - x) / (3.0 * (y / (1.0 - x)))
function code(x, y) return Float64(Float64(3.0 - x) / Float64(3.0 * Float64(y / Float64(1.0 - x)))) end
function tmp = code(x, y) tmp = (3.0 - x) / (3.0 * (y / (1.0 - x))); end
code[x_, y_] := N[(N[(3.0 - x), $MachinePrecision] / N[(3.0 * N[(y / N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{3 - x}{3 \cdot \frac{y}{1 - x}}
\end{array}
Initial program 95.7%
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Final simplification99.7%
(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.0%
Taylor expanded in x around 0
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/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-/.f6429.4%
Simplified29.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
/-lowering-/.f6429.4%
Simplified29.4%
if -0.75 < x Initial program 96.7%
Taylor expanded in x around 0
/-lowering-/.f6469.8%
Simplified69.8%
Final simplification59.2%
(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 95.7%
Taylor expanded in x around 0
/-lowering-/.f6452.8%
Simplified52.8%
(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 2024150
(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)))