
(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 17 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 (* (/ (- 1.0 x) y) (- 1.0 (/ x 3.0))))
double code(double x, double y) {
return ((1.0 - x) / y) * (1.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) * (1.0d0 - (x / 3.0d0))
end function
public static double code(double x, double y) {
return ((1.0 - x) / y) * (1.0 - (x / 3.0));
}
def code(x, y): return ((1.0 - x) / y) * (1.0 - (x / 3.0))
function code(x, y) return Float64(Float64(Float64(1.0 - x) / y) * Float64(1.0 - Float64(x / 3.0))) end
function tmp = code(x, y) tmp = ((1.0 - x) / y) * (1.0 - (x / 3.0)); end
code[x_, y_] := N[(N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision] * N[(1.0 - N[(x / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 - x}{y} \cdot \left(1 - \frac{x}{3}\right)
\end{array}
Initial program 93.8%
times-frac99.8%
div-sub99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y) :precision binary64 (if (or (<= x -3.0) (not (<= x 3.0))) (* (- 1.0 x) (* -0.3333333333333333 (/ x y))) (* (- 1.0 x) (/ 1.0 y))))
double code(double x, double y) {
double tmp;
if ((x <= -3.0) || !(x <= 3.0)) {
tmp = (1.0 - x) * (-0.3333333333333333 * (x / y));
} else {
tmp = (1.0 - x) * (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 <= (-3.0d0)) .or. (.not. (x <= 3.0d0))) then
tmp = (1.0d0 - x) * ((-0.3333333333333333d0) * (x / y))
else
tmp = (1.0d0 - x) * (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -3.0) || !(x <= 3.0)) {
tmp = (1.0 - x) * (-0.3333333333333333 * (x / y));
} else {
tmp = (1.0 - x) * (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -3.0) or not (x <= 3.0): tmp = (1.0 - x) * (-0.3333333333333333 * (x / y)) else: tmp = (1.0 - x) * (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if ((x <= -3.0) || !(x <= 3.0)) tmp = Float64(Float64(1.0 - x) * Float64(-0.3333333333333333 * Float64(x / y))); else tmp = Float64(Float64(1.0 - x) * Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -3.0) || ~((x <= 3.0))) tmp = (1.0 - x) * (-0.3333333333333333 * (x / y)); else tmp = (1.0 - x) * (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -3.0], N[Not[LessEqual[x, 3.0]], $MachinePrecision]], N[(N[(1.0 - x), $MachinePrecision] * N[(-0.3333333333333333 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \lor \neg \left(x \leq 3\right):\\
\;\;\;\;\left(1 - x\right) \cdot \left(-0.3333333333333333 \cdot \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -3 or 3 < x Initial program 89.1%
*-commutative89.1%
associate-*l/99.8%
*-commutative99.8%
*-lft-identity99.8%
associate-*l/99.8%
*-commutative99.8%
*-commutative99.8%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 97.5%
if -3 < x < 3Initial program 99.5%
*-commutative99.5%
associate-*l/99.5%
*-commutative99.5%
*-lft-identity99.5%
associate-*l/99.3%
*-commutative99.3%
*-commutative99.3%
associate-/r*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 98.6%
Final simplification98.0%
(FPCore (x y) :precision binary64 (if (or (<= x -1.35) (not (<= x 2.3))) (* (/ x y) (- -1.3333333333333333 (/ x -3.0))) (* (- 1.0 x) (/ 1.0 y))))
double code(double x, double y) {
double tmp;
if ((x <= -1.35) || !(x <= 2.3)) {
tmp = (x / y) * (-1.3333333333333333 - (x / -3.0));
} else {
tmp = (1.0 - x) * (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 <= (-1.35d0)) .or. (.not. (x <= 2.3d0))) then
tmp = (x / y) * ((-1.3333333333333333d0) - (x / (-3.0d0)))
else
tmp = (1.0d0 - x) * (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -1.35) || !(x <= 2.3)) {
tmp = (x / y) * (-1.3333333333333333 - (x / -3.0));
} else {
tmp = (1.0 - x) * (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -1.35) or not (x <= 2.3): tmp = (x / y) * (-1.3333333333333333 - (x / -3.0)) else: tmp = (1.0 - x) * (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if ((x <= -1.35) || !(x <= 2.3)) tmp = Float64(Float64(x / y) * Float64(-1.3333333333333333 - Float64(x / -3.0))); else tmp = Float64(Float64(1.0 - x) * Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -1.35) || ~((x <= 2.3))) tmp = (x / y) * (-1.3333333333333333 - (x / -3.0)); else tmp = (1.0 - x) * (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -1.35], N[Not[LessEqual[x, 2.3]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * N[(-1.3333333333333333 - N[(x / -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \lor \neg \left(x \leq 2.3\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(-1.3333333333333333 - \frac{x}{-3}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -1.3500000000000001 or 2.2999999999999998 < x Initial program 89.1%
Taylor expanded in x around inf 88.2%
+-commutative88.2%
unpow288.2%
distribute-rgt-out88.2%
Simplified88.2%
associate-/l*98.9%
associate-/r/98.9%
Applied egg-rr98.9%
*-commutative98.9%
clear-num98.9%
un-div-inv98.9%
*-commutative98.9%
associate-/l*98.9%
Applied egg-rr98.9%
expm1-log1p-u56.1%
expm1-udef45.7%
associate-/r/45.7%
*-commutative45.7%
frac-2neg45.7%
neg-sub045.7%
+-commutative45.7%
associate--r+45.7%
metadata-eval45.7%
metadata-eval45.7%
Applied egg-rr45.7%
expm1-def56.1%
expm1-log1p98.8%
div-sub98.8%
metadata-eval98.8%
Simplified98.8%
if -1.3500000000000001 < x < 2.2999999999999998Initial program 99.5%
*-commutative99.5%
associate-*l/99.5%
*-commutative99.5%
*-lft-identity99.5%
associate-*l/99.3%
*-commutative99.3%
*-commutative99.3%
associate-/r*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 98.6%
Final simplification98.7%
(FPCore (x y)
:precision binary64
(if (<= x -3.0)
(* (- 1.0 x) (* -0.3333333333333333 (/ x y)))
(if (<= x 3.0)
(* (- 1.0 x) (/ 1.0 y))
(* (- 1.0 x) (/ x (/ y -0.3333333333333333))))))
double code(double x, double y) {
double tmp;
if (x <= -3.0) {
tmp = (1.0 - x) * (-0.3333333333333333 * (x / y));
} else if (x <= 3.0) {
tmp = (1.0 - x) * (1.0 / y);
} else {
tmp = (1.0 - 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 <= (-3.0d0)) then
tmp = (1.0d0 - x) * ((-0.3333333333333333d0) * (x / y))
else if (x <= 3.0d0) then
tmp = (1.0d0 - x) * (1.0d0 / y)
else
tmp = (1.0d0 - x) * (x / (y / (-0.3333333333333333d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.0) {
tmp = (1.0 - x) * (-0.3333333333333333 * (x / y));
} else if (x <= 3.0) {
tmp = (1.0 - x) * (1.0 / y);
} else {
tmp = (1.0 - x) * (x / (y / -0.3333333333333333));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.0: tmp = (1.0 - x) * (-0.3333333333333333 * (x / y)) elif x <= 3.0: tmp = (1.0 - x) * (1.0 / y) else: tmp = (1.0 - x) * (x / (y / -0.3333333333333333)) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.0) tmp = Float64(Float64(1.0 - x) * Float64(-0.3333333333333333 * Float64(x / y))); elseif (x <= 3.0) tmp = Float64(Float64(1.0 - x) * Float64(1.0 / y)); else tmp = Float64(Float64(1.0 - x) * Float64(x / Float64(y / -0.3333333333333333))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.0) tmp = (1.0 - x) * (-0.3333333333333333 * (x / y)); elseif (x <= 3.0) tmp = (1.0 - x) * (1.0 / y); else tmp = (1.0 - x) * (x / (y / -0.3333333333333333)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.0], N[(N[(1.0 - x), $MachinePrecision] * N[(-0.3333333333333333 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.0], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * N[(x / N[(y / -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3:\\
\;\;\;\;\left(1 - x\right) \cdot \left(-0.3333333333333333 \cdot \frac{x}{y}\right)\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\left(1 - x\right) \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot \frac{x}{\frac{y}{-0.3333333333333333}}\\
\end{array}
\end{array}
if x < -3Initial program 90.4%
*-commutative90.4%
associate-*l/99.8%
*-commutative99.8%
*-lft-identity99.8%
associate-*l/99.7%
*-commutative99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 96.8%
if -3 < x < 3Initial program 99.5%
*-commutative99.5%
associate-*l/99.5%
*-commutative99.5%
*-lft-identity99.5%
associate-*l/99.3%
*-commutative99.3%
*-commutative99.3%
associate-/r*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 98.6%
if 3 < x Initial program 87.3%
*-commutative87.3%
associate-*l/99.8%
*-commutative99.8%
*-lft-identity99.8%
associate-*l/99.8%
*-commutative99.8%
*-commutative99.8%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 98.5%
associate-*r/98.6%
*-commutative98.6%
associate-/l*98.5%
Simplified98.5%
Final simplification98.0%
(FPCore (x y)
:precision binary64
(if (<= x -3.0)
(* (- 1.0 x) (* -0.3333333333333333 (/ x y)))
(if (<= x 3.0)
(* (- 1.0 x) (/ 1.0 y))
(* (- 1.0 x) (/ (* x -0.3333333333333333) y)))))
double code(double x, double y) {
double tmp;
if (x <= -3.0) {
tmp = (1.0 - x) * (-0.3333333333333333 * (x / y));
} else if (x <= 3.0) {
tmp = (1.0 - x) * (1.0 / y);
} else {
tmp = (1.0 - x) * ((x * -0.3333333333333333) / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.0d0)) then
tmp = (1.0d0 - x) * ((-0.3333333333333333d0) * (x / y))
else if (x <= 3.0d0) then
tmp = (1.0d0 - x) * (1.0d0 / y)
else
tmp = (1.0d0 - x) * ((x * (-0.3333333333333333d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.0) {
tmp = (1.0 - x) * (-0.3333333333333333 * (x / y));
} else if (x <= 3.0) {
tmp = (1.0 - x) * (1.0 / y);
} else {
tmp = (1.0 - x) * ((x * -0.3333333333333333) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.0: tmp = (1.0 - x) * (-0.3333333333333333 * (x / y)) elif x <= 3.0: tmp = (1.0 - x) * (1.0 / y) else: tmp = (1.0 - x) * ((x * -0.3333333333333333) / y) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.0) tmp = Float64(Float64(1.0 - x) * Float64(-0.3333333333333333 * Float64(x / y))); elseif (x <= 3.0) tmp = Float64(Float64(1.0 - x) * Float64(1.0 / y)); else tmp = Float64(Float64(1.0 - x) * Float64(Float64(x * -0.3333333333333333) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.0) tmp = (1.0 - x) * (-0.3333333333333333 * (x / y)); elseif (x <= 3.0) tmp = (1.0 - x) * (1.0 / y); else tmp = (1.0 - x) * ((x * -0.3333333333333333) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.0], N[(N[(1.0 - x), $MachinePrecision] * N[(-0.3333333333333333 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.0], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * N[(N[(x * -0.3333333333333333), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3:\\
\;\;\;\;\left(1 - x\right) \cdot \left(-0.3333333333333333 \cdot \frac{x}{y}\right)\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\left(1 - x\right) \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot \frac{x \cdot -0.3333333333333333}{y}\\
\end{array}
\end{array}
if x < -3Initial program 90.4%
*-commutative90.4%
associate-*l/99.8%
*-commutative99.8%
*-lft-identity99.8%
associate-*l/99.7%
*-commutative99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 96.8%
if -3 < x < 3Initial program 99.5%
*-commutative99.5%
associate-*l/99.5%
*-commutative99.5%
*-lft-identity99.5%
associate-*l/99.3%
*-commutative99.3%
*-commutative99.3%
associate-/r*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 98.6%
if 3 < x Initial program 87.3%
*-commutative87.3%
associate-*l/99.8%
*-commutative99.8%
*-lft-identity99.8%
associate-*l/99.8%
*-commutative99.8%
*-commutative99.8%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 98.5%
associate-*r/98.6%
*-commutative98.6%
Applied egg-rr98.6%
Final simplification98.0%
(FPCore (x y) :precision binary64 (if (<= x -1.35) (* (/ x y) (- -1.3333333333333333 (/ x -3.0))) (if (<= x 2.3) (* (- 1.0 x) (/ 1.0 y)) (* (+ x -4.0) (/ x (* y 3.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.35) {
tmp = (x / y) * (-1.3333333333333333 - (x / -3.0));
} else if (x <= 2.3) {
tmp = (1.0 - x) * (1.0 / y);
} else {
tmp = (x + -4.0) * (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 <= (-1.35d0)) then
tmp = (x / y) * ((-1.3333333333333333d0) - (x / (-3.0d0)))
else if (x <= 2.3d0) then
tmp = (1.0d0 - x) * (1.0d0 / y)
else
tmp = (x + (-4.0d0)) * (x / (y * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.35) {
tmp = (x / y) * (-1.3333333333333333 - (x / -3.0));
} else if (x <= 2.3) {
tmp = (1.0 - x) * (1.0 / y);
} else {
tmp = (x + -4.0) * (x / (y * 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.35: tmp = (x / y) * (-1.3333333333333333 - (x / -3.0)) elif x <= 2.3: tmp = (1.0 - x) * (1.0 / y) else: tmp = (x + -4.0) * (x / (y * 3.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.35) tmp = Float64(Float64(x / y) * Float64(-1.3333333333333333 - Float64(x / -3.0))); elseif (x <= 2.3) tmp = Float64(Float64(1.0 - x) * Float64(1.0 / y)); else tmp = Float64(Float64(x + -4.0) * Float64(x / Float64(y * 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.35) tmp = (x / y) * (-1.3333333333333333 - (x / -3.0)); elseif (x <= 2.3) tmp = (1.0 - x) * (1.0 / y); else tmp = (x + -4.0) * (x / (y * 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.35], N[(N[(x / y), $MachinePrecision] * N[(-1.3333333333333333 - N[(x / -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(x + -4.0), $MachinePrecision] * N[(x / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35:\\
\;\;\;\;\frac{x}{y} \cdot \left(-1.3333333333333333 - \frac{x}{-3}\right)\\
\mathbf{elif}\;x \leq 2.3:\\
\;\;\;\;\left(1 - x\right) \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x + -4\right) \cdot \frac{x}{y \cdot 3}\\
\end{array}
\end{array}
if x < -1.3500000000000001Initial program 90.4%
Taylor expanded in x around inf 89.3%
+-commutative89.3%
unpow289.3%
distribute-rgt-out89.3%
Simplified89.3%
associate-/l*98.7%
associate-/r/98.7%
Applied egg-rr98.7%
*-commutative98.7%
clear-num98.7%
un-div-inv98.8%
*-commutative98.8%
associate-/l*98.7%
Applied egg-rr98.7%
expm1-log1p-u54.9%
expm1-udef41.4%
associate-/r/41.4%
*-commutative41.4%
frac-2neg41.4%
neg-sub041.4%
+-commutative41.4%
associate--r+41.4%
metadata-eval41.4%
metadata-eval41.4%
Applied egg-rr41.4%
expm1-def54.8%
expm1-log1p98.7%
div-sub98.7%
metadata-eval98.7%
Simplified98.7%
if -1.3500000000000001 < x < 2.2999999999999998Initial program 99.5%
*-commutative99.5%
associate-*l/99.5%
*-commutative99.5%
*-lft-identity99.5%
associate-*l/99.3%
*-commutative99.3%
*-commutative99.3%
associate-/r*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 98.6%
if 2.2999999999999998 < x Initial program 87.3%
Taylor expanded in x around inf 86.7%
+-commutative86.7%
unpow286.7%
distribute-rgt-out86.7%
Simplified86.7%
associate-/l*99.1%
associate-/r/99.2%
Applied egg-rr99.2%
Final simplification98.8%
(FPCore (x y)
:precision binary64
(if (<= x -1.75)
(* (/ x y) (- -1.3333333333333333 (/ x -3.0)))
(if (<= x 1.7)
(/ (+ 3.0 (* x -4.0)) (* y 3.0))
(* (+ x -4.0) (/ x (* y 3.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = (x / y) * (-1.3333333333333333 - (x / -3.0));
} else if (x <= 1.7) {
tmp = (3.0 + (x * -4.0)) / (y * 3.0);
} else {
tmp = (x + -4.0) * (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 <= (-1.75d0)) then
tmp = (x / y) * ((-1.3333333333333333d0) - (x / (-3.0d0)))
else if (x <= 1.7d0) then
tmp = (3.0d0 + (x * (-4.0d0))) / (y * 3.0d0)
else
tmp = (x + (-4.0d0)) * (x / (y * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = (x / y) * (-1.3333333333333333 - (x / -3.0));
} else if (x <= 1.7) {
tmp = (3.0 + (x * -4.0)) / (y * 3.0);
} else {
tmp = (x + -4.0) * (x / (y * 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.75: tmp = (x / y) * (-1.3333333333333333 - (x / -3.0)) elif x <= 1.7: tmp = (3.0 + (x * -4.0)) / (y * 3.0) else: tmp = (x + -4.0) * (x / (y * 3.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.75) tmp = Float64(Float64(x / y) * Float64(-1.3333333333333333 - Float64(x / -3.0))); elseif (x <= 1.7) tmp = Float64(Float64(3.0 + Float64(x * -4.0)) / Float64(y * 3.0)); else tmp = Float64(Float64(x + -4.0) * Float64(x / Float64(y * 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.75) tmp = (x / y) * (-1.3333333333333333 - (x / -3.0)); elseif (x <= 1.7) tmp = (3.0 + (x * -4.0)) / (y * 3.0); else tmp = (x + -4.0) * (x / (y * 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.75], N[(N[(x / y), $MachinePrecision] * N[(-1.3333333333333333 - N[(x / -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7], N[(N[(3.0 + N[(x * -4.0), $MachinePrecision]), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + -4.0), $MachinePrecision] * N[(x / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;\frac{x}{y} \cdot \left(-1.3333333333333333 - \frac{x}{-3}\right)\\
\mathbf{elif}\;x \leq 1.7:\\
\;\;\;\;\frac{3 + x \cdot -4}{y \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\left(x + -4\right) \cdot \frac{x}{y \cdot 3}\\
\end{array}
\end{array}
if x < -1.75Initial program 90.4%
Taylor expanded in x around inf 89.3%
+-commutative89.3%
unpow289.3%
distribute-rgt-out89.3%
Simplified89.3%
associate-/l*98.7%
associate-/r/98.7%
Applied egg-rr98.7%
*-commutative98.7%
clear-num98.7%
un-div-inv98.8%
*-commutative98.8%
associate-/l*98.7%
Applied egg-rr98.7%
expm1-log1p-u54.9%
expm1-udef41.4%
associate-/r/41.4%
*-commutative41.4%
frac-2neg41.4%
neg-sub041.4%
+-commutative41.4%
associate--r+41.4%
metadata-eval41.4%
metadata-eval41.4%
Applied egg-rr41.4%
expm1-def54.8%
expm1-log1p98.7%
div-sub98.7%
metadata-eval98.7%
Simplified98.7%
if -1.75 < x < 1.69999999999999996Initial program 99.5%
Taylor expanded in x around 0 99.0%
*-commutative99.0%
Simplified99.0%
if 1.69999999999999996 < x Initial program 87.3%
Taylor expanded in x around inf 86.7%
+-commutative86.7%
unpow286.7%
distribute-rgt-out86.7%
Simplified86.7%
associate-/l*99.1%
associate-/r/99.2%
Applied egg-rr99.2%
Final simplification99.0%
(FPCore (x y)
:precision binary64
(if (<= x -1.75)
(/ (+ x -4.0) (/ 3.0 (/ x y)))
(if (<= x 1.7)
(/ (+ 3.0 (* x -4.0)) (* y 3.0))
(* (+ x -4.0) (/ x (* y 3.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = (x + -4.0) / (3.0 / (x / y));
} else if (x <= 1.7) {
tmp = (3.0 + (x * -4.0)) / (y * 3.0);
} else {
tmp = (x + -4.0) * (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 <= (-1.75d0)) then
tmp = (x + (-4.0d0)) / (3.0d0 / (x / y))
else if (x <= 1.7d0) then
tmp = (3.0d0 + (x * (-4.0d0))) / (y * 3.0d0)
else
tmp = (x + (-4.0d0)) * (x / (y * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = (x + -4.0) / (3.0 / (x / y));
} else if (x <= 1.7) {
tmp = (3.0 + (x * -4.0)) / (y * 3.0);
} else {
tmp = (x + -4.0) * (x / (y * 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.75: tmp = (x + -4.0) / (3.0 / (x / y)) elif x <= 1.7: tmp = (3.0 + (x * -4.0)) / (y * 3.0) else: tmp = (x + -4.0) * (x / (y * 3.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.75) tmp = Float64(Float64(x + -4.0) / Float64(3.0 / Float64(x / y))); elseif (x <= 1.7) tmp = Float64(Float64(3.0 + Float64(x * -4.0)) / Float64(y * 3.0)); else tmp = Float64(Float64(x + -4.0) * Float64(x / Float64(y * 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.75) tmp = (x + -4.0) / (3.0 / (x / y)); elseif (x <= 1.7) tmp = (3.0 + (x * -4.0)) / (y * 3.0); else tmp = (x + -4.0) * (x / (y * 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.75], N[(N[(x + -4.0), $MachinePrecision] / N[(3.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7], N[(N[(3.0 + N[(x * -4.0), $MachinePrecision]), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + -4.0), $MachinePrecision] * N[(x / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;\frac{x + -4}{\frac{3}{\frac{x}{y}}}\\
\mathbf{elif}\;x \leq 1.7:\\
\;\;\;\;\frac{3 + x \cdot -4}{y \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\left(x + -4\right) \cdot \frac{x}{y \cdot 3}\\
\end{array}
\end{array}
if x < -1.75Initial program 90.4%
Taylor expanded in x around inf 89.3%
+-commutative89.3%
unpow289.3%
distribute-rgt-out89.3%
Simplified89.3%
associate-/l*98.7%
associate-/r/98.7%
Applied egg-rr98.7%
*-commutative98.7%
clear-num98.7%
un-div-inv98.8%
*-commutative98.8%
associate-/l*98.7%
Applied egg-rr98.7%
if -1.75 < x < 1.69999999999999996Initial program 99.5%
Taylor expanded in x around 0 99.0%
*-commutative99.0%
Simplified99.0%
if 1.69999999999999996 < x Initial program 87.3%
Taylor expanded in x around inf 86.7%
+-commutative86.7%
unpow286.7%
distribute-rgt-out86.7%
Simplified86.7%
associate-/l*99.1%
associate-/r/99.2%
Applied egg-rr99.2%
Final simplification99.0%
(FPCore (x y)
:precision binary64
(if (<= x -1.75)
(/ (+ x -4.0) (/ y (/ x 3.0)))
(if (<= x 1.7)
(/ (+ 3.0 (* x -4.0)) (* y 3.0))
(* (+ x -4.0) (/ x (* y 3.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.75) {
tmp = (x + -4.0) / (y / (x / 3.0));
} else if (x <= 1.7) {
tmp = (3.0 + (x * -4.0)) / (y * 3.0);
} else {
tmp = (x + -4.0) * (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 <= (-1.75d0)) then
tmp = (x + (-4.0d0)) / (y / (x / 3.0d0))
else if (x <= 1.7d0) then
tmp = (3.0d0 + (x * (-4.0d0))) / (y * 3.0d0)
else
tmp = (x + (-4.0d0)) * (x / (y * 3.0d0))
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 / (x / 3.0));
} else if (x <= 1.7) {
tmp = (3.0 + (x * -4.0)) / (y * 3.0);
} else {
tmp = (x + -4.0) * (x / (y * 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.75: tmp = (x + -4.0) / (y / (x / 3.0)) elif x <= 1.7: tmp = (3.0 + (x * -4.0)) / (y * 3.0) else: tmp = (x + -4.0) * (x / (y * 3.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.75) tmp = Float64(Float64(x + -4.0) / Float64(y / Float64(x / 3.0))); elseif (x <= 1.7) tmp = Float64(Float64(3.0 + Float64(x * -4.0)) / Float64(y * 3.0)); else tmp = Float64(Float64(x + -4.0) * Float64(x / Float64(y * 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.75) tmp = (x + -4.0) / (y / (x / 3.0)); elseif (x <= 1.7) tmp = (3.0 + (x * -4.0)) / (y * 3.0); else tmp = (x + -4.0) * (x / (y * 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.75], N[(N[(x + -4.0), $MachinePrecision] / N[(y / N[(x / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7], N[(N[(3.0 + N[(x * -4.0), $MachinePrecision]), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + -4.0), $MachinePrecision] * N[(x / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;\frac{x + -4}{\frac{y}{\frac{x}{3}}}\\
\mathbf{elif}\;x \leq 1.7:\\
\;\;\;\;\frac{3 + x \cdot -4}{y \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\left(x + -4\right) \cdot \frac{x}{y \cdot 3}\\
\end{array}
\end{array}
if x < -1.75Initial program 90.4%
Taylor expanded in x around inf 89.3%
+-commutative89.3%
unpow289.3%
distribute-rgt-out89.3%
Simplified89.3%
associate-/l*98.7%
associate-/r/98.7%
Applied egg-rr98.7%
*-commutative98.7%
clear-num98.7%
un-div-inv98.8%
*-commutative98.8%
associate-/l*98.7%
Applied egg-rr98.7%
Taylor expanded in x around 0 98.7%
associate-*r/98.8%
*-commutative98.8%
associate-/l*98.8%
Simplified98.8%
if -1.75 < x < 1.69999999999999996Initial program 99.5%
Taylor expanded in x around 0 99.0%
*-commutative99.0%
Simplified99.0%
if 1.69999999999999996 < x Initial program 87.3%
Taylor expanded in x around inf 86.7%
+-commutative86.7%
unpow286.7%
distribute-rgt-out86.7%
Simplified86.7%
associate-/l*99.1%
associate-/r/99.2%
Applied egg-rr99.2%
Final simplification99.0%
(FPCore (x y) :precision binary64 (* (- 1.0 x) (* (- 3.0 x) (/ 0.3333333333333333 y))))
double code(double x, double y) {
return (1.0 - x) * ((3.0 - x) * (0.3333333333333333 / y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) * ((3.0d0 - x) * (0.3333333333333333d0 / y))
end function
public static double code(double x, double y) {
return (1.0 - x) * ((3.0 - x) * (0.3333333333333333 / y));
}
def code(x, y): return (1.0 - x) * ((3.0 - x) * (0.3333333333333333 / y))
function code(x, y) return Float64(Float64(1.0 - x) * Float64(Float64(3.0 - x) * Float64(0.3333333333333333 / y))) end
function tmp = code(x, y) tmp = (1.0 - x) * ((3.0 - x) * (0.3333333333333333 / y)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] * N[(N[(3.0 - x), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) \cdot \left(\left(3 - x\right) \cdot \frac{0.3333333333333333}{y}\right)
\end{array}
Initial program 93.8%
*-commutative93.8%
associate-*l/99.7%
*-commutative99.7%
*-lft-identity99.7%
associate-*l/99.5%
*-commutative99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y) :precision binary64 (* (- 3.0 x) (/ (- 1.0 x) (* y 3.0))))
double code(double x, double y) {
return (3.0 - x) * ((1.0 - x) / (y * 3.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (3.0d0 - x) * ((1.0d0 - x) / (y * 3.0d0))
end function
public static double code(double x, double y) {
return (3.0 - x) * ((1.0 - x) / (y * 3.0));
}
def code(x, y): return (3.0 - x) * ((1.0 - x) / (y * 3.0))
function code(x, y) return Float64(Float64(3.0 - x) * Float64(Float64(1.0 - x) / Float64(y * 3.0))) end
function tmp = code(x, y) tmp = (3.0 - x) * ((1.0 - x) / (y * 3.0)); end
code[x_, y_] := N[(N[(3.0 - x), $MachinePrecision] * N[(N[(1.0 - x), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 - x\right) \cdot \frac{1 - x}{y \cdot 3}
\end{array}
Initial program 93.8%
*-commutative93.8%
associate-*r/99.6%
*-commutative99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y) :precision binary64 (* (- 1.0 x) (/ (+ 1.0 (* x -0.3333333333333333)) y)))
double code(double x, double y) {
return (1.0 - x) * ((1.0 + (x * -0.3333333333333333)) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) * ((1.0d0 + (x * (-0.3333333333333333d0))) / y)
end function
public static double code(double x, double y) {
return (1.0 - x) * ((1.0 + (x * -0.3333333333333333)) / y);
}
def code(x, y): return (1.0 - x) * ((1.0 + (x * -0.3333333333333333)) / y)
function code(x, y) return Float64(Float64(1.0 - x) * Float64(Float64(1.0 + Float64(x * -0.3333333333333333)) / y)) end
function tmp = code(x, y) tmp = (1.0 - x) * ((1.0 + (x * -0.3333333333333333)) / y); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] * N[(N[(1.0 + N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) \cdot \frac{1 + x \cdot -0.3333333333333333}{y}
\end{array}
Initial program 93.8%
div-inv93.7%
*-commutative93.7%
associate-/r*93.7%
metadata-eval93.7%
associate-*r*99.5%
*-commutative99.5%
associate-*r/99.8%
metadata-eval99.8%
div-inv99.8%
div-sub99.8%
metadata-eval99.8%
sub-neg99.8%
div-inv99.8%
metadata-eval99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y) :precision binary64 (if (<= x -0.75) (* (/ x y) -1.3333333333333333) (* 3.0 (/ 0.3333333333333333 y))))
double code(double x, double y) {
double tmp;
if (x <= -0.75) {
tmp = (x / y) * -1.3333333333333333;
} else {
tmp = 3.0 * (0.3333333333333333 / 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 = 3.0d0 * (0.3333333333333333d0 / 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 = 3.0 * (0.3333333333333333 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.75: tmp = (x / y) * -1.3333333333333333 else: tmp = 3.0 * (0.3333333333333333 / y) return tmp
function code(x, y) tmp = 0.0 if (x <= -0.75) tmp = Float64(Float64(x / y) * -1.3333333333333333); else tmp = Float64(3.0 * Float64(0.3333333333333333 / 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 = 3.0 * (0.3333333333333333 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.75], N[(N[(x / y), $MachinePrecision] * -1.3333333333333333), $MachinePrecision], N[(3.0 * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.75:\\
\;\;\;\;\frac{x}{y} \cdot -1.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \frac{0.3333333333333333}{y}\\
\end{array}
\end{array}
if x < -0.75Initial program 90.4%
Taylor expanded in x around inf 89.3%
+-commutative89.3%
unpow289.3%
distribute-rgt-out89.3%
Simplified89.3%
Taylor expanded in x around 0 29.9%
if -0.75 < x Initial program 95.4%
Taylor expanded in x around 0 66.6%
div-inv66.4%
*-commutative66.4%
*-commutative66.4%
associate-/r*66.5%
metadata-eval66.5%
Applied egg-rr66.5%
Final simplification55.1%
(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 90.4%
Taylor expanded in x around inf 89.3%
+-commutative89.3%
unpow289.3%
distribute-rgt-out89.3%
Simplified89.3%
Taylor expanded in x around 0 29.9%
if -0.75 < x Initial program 95.4%
Taylor expanded in x around 0 66.6%
*-un-lft-identity66.6%
*-commutative66.6%
*-commutative66.6%
associate-/r*66.9%
metadata-eval66.9%
Applied egg-rr66.9%
Final simplification55.3%
(FPCore (x y) :precision binary64 (* (- 1.0 x) (/ 1.0 y)))
double code(double x, double y) {
return (1.0 - x) * (1.0 / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) * (1.0d0 / y)
end function
public static double code(double x, double y) {
return (1.0 - x) * (1.0 / y);
}
def code(x, y): return (1.0 - x) * (1.0 / y)
function code(x, y) return Float64(Float64(1.0 - x) * Float64(1.0 / y)) end
function tmp = code(x, y) tmp = (1.0 - x) * (1.0 / y); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) \cdot \frac{1}{y}
\end{array}
Initial program 93.8%
*-commutative93.8%
associate-*l/99.7%
*-commutative99.7%
*-lft-identity99.7%
associate-*l/99.5%
*-commutative99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 54.5%
Final simplification54.5%
(FPCore (x y) :precision binary64 (* (/ x y) -1.3333333333333333))
double code(double x, double y) {
return (x / y) * -1.3333333333333333;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / y) * (-1.3333333333333333d0)
end function
public static double code(double x, double y) {
return (x / y) * -1.3333333333333333;
}
def code(x, y): return (x / y) * -1.3333333333333333
function code(x, y) return Float64(Float64(x / y) * -1.3333333333333333) end
function tmp = code(x, y) tmp = (x / y) * -1.3333333333333333; end
code[x_, y_] := N[(N[(x / y), $MachinePrecision] * -1.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot -1.3333333333333333
\end{array}
Initial program 93.8%
Taylor expanded in x around inf 50.0%
+-commutative50.0%
unpow250.0%
distribute-rgt-out49.9%
Simplified49.9%
Taylor expanded in x around 0 11.5%
Final simplification11.5%
(FPCore (x y) :precision binary64 (/ (- x) y))
double code(double x, double y) {
return -x / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -x / y
end function
public static double code(double x, double y) {
return -x / y;
}
def code(x, y): return -x / y
function code(x, y) return Float64(Float64(-x) / y) end
function tmp = code(x, y) tmp = -x / y; end
code[x_, y_] := N[((-x) / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{y}
\end{array}
Initial program 93.8%
times-frac99.8%
div-sub99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 55.1%
mul-1-neg55.1%
distribute-neg-frac55.1%
Simplified55.1%
Taylor expanded in x around 0 11.5%
mul-1-neg11.5%
Simplified11.5%
Final simplification11.5%
(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 2023301
(FPCore (x y)
:name "Diagrams.TwoD.Arc:bezierFromSweepQ1 from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(* (/ (- 1.0 x) y) (/ (- 3.0 x) 3.0))
(/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))