
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (sin t_0))
(t_2 (cos t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) t_2) x-scale)
y-scale)))
(-
(* t_3 t_3)
(*
(*
4.0
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) x-scale) x-scale))
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) y-scale) y-scale)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = sin(t_0);
double t_2 = cos(t_0);
double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale;
return (t_3 * t_3) - ((4.0 * (((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * Math.PI;
double t_1 = Math.sin(t_0);
double t_2 = Math.cos(t_0);
double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale;
return (t_3 * t_3) - ((4.0 * (((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale));
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (angle / 180.0) * math.pi t_1 = math.sin(t_0) t_2 = math.cos(t_0) t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale return (t_3 * t_3) - ((4.0 * (((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale))
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = sin(t_0) t_2 = cos(t_0) t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale) return Float64(Float64(t_3 * t_3) - Float64(Float64(4.0 * Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale)) * Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale))) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = sin(t_0); t_2 = cos(t_0); t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale; tmp = (t_3 * t_3) - ((4.0 * (((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale)) * (((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale)); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, N[(N[(t$95$3 * t$95$3), $MachinePrecision] - N[(N[(4.0 * N[(N[(N[(N[Power[N[(a * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Power[N[(a * t$95$2), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\\
t\_3 \cdot t\_3 - \left(4 \cdot \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\right) \cdot \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (sin t_0))
(t_2 (cos t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) t_2) x-scale)
y-scale)))
(-
(* t_3 t_3)
(*
(*
4.0
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) x-scale) x-scale))
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) y-scale) y-scale)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = sin(t_0);
double t_2 = cos(t_0);
double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale;
return (t_3 * t_3) - ((4.0 * (((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * Math.PI;
double t_1 = Math.sin(t_0);
double t_2 = Math.cos(t_0);
double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale;
return (t_3 * t_3) - ((4.0 * (((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale));
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (angle / 180.0) * math.pi t_1 = math.sin(t_0) t_2 = math.cos(t_0) t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale return (t_3 * t_3) - ((4.0 * (((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale))
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = sin(t_0) t_2 = cos(t_0) t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale) return Float64(Float64(t_3 * t_3) - Float64(Float64(4.0 * Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale)) * Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale))) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = sin(t_0); t_2 = cos(t_0); t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale; tmp = (t_3 * t_3) - ((4.0 * (((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale)) * (((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale)); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, N[(N[(t$95$3 * t$95$3), $MachinePrecision] - N[(N[(4.0 * N[(N[(N[(N[Power[N[(a * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Power[N[(a * t$95$2), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\\
t\_3 \cdot t\_3 - \left(4 \cdot \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\right) \cdot \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale}
\end{array}
\end{array}
x-scale_m = (fabs.f64 x-scale)
(FPCore (a b angle x-scale_m y-scale)
:precision binary64
(if (<= x-scale_m 5.5e-95)
(/
(/ a (/ y-scale -4.0))
(/ (* x-scale_m y-scale) (/ b (/ x-scale_m (* a b)))))
(if (<= x-scale_m 4.8e+159)
(/
(/ (* a b) (/ y-scale -4.0))
(* y-scale (/ x-scale_m (/ (* a b) x-scale_m))))
(*
b
(/
(/ a (/ (* x-scale_m y-scale) (/ b (/ y-scale -4.0))))
(/ x-scale_m a))))))x-scale_m = fabs(x_45_scale);
double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
double tmp;
if (x_45_scale_m <= 5.5e-95) {
tmp = (a / (y_45_scale / -4.0)) / ((x_45_scale_m * y_45_scale) / (b / (x_45_scale_m / (a * b))));
} else if (x_45_scale_m <= 4.8e+159) {
tmp = ((a * b) / (y_45_scale / -4.0)) / (y_45_scale * (x_45_scale_m / ((a * b) / x_45_scale_m)));
} else {
tmp = b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a));
}
return tmp;
}
x-scale_m = abs(x_45scale)
real(8) function code(a, b, angle, x_45scale_m, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale_m
real(8), intent (in) :: y_45scale
real(8) :: tmp
if (x_45scale_m <= 5.5d-95) then
tmp = (a / (y_45scale / (-4.0d0))) / ((x_45scale_m * y_45scale) / (b / (x_45scale_m / (a * b))))
else if (x_45scale_m <= 4.8d+159) then
tmp = ((a * b) / (y_45scale / (-4.0d0))) / (y_45scale * (x_45scale_m / ((a * b) / x_45scale_m)))
else
tmp = b * ((a / ((x_45scale_m * y_45scale) / (b / (y_45scale / (-4.0d0))))) / (x_45scale_m / a))
end if
code = tmp
end function
x-scale_m = Math.abs(x_45_scale);
public static double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
double tmp;
if (x_45_scale_m <= 5.5e-95) {
tmp = (a / (y_45_scale / -4.0)) / ((x_45_scale_m * y_45_scale) / (b / (x_45_scale_m / (a * b))));
} else if (x_45_scale_m <= 4.8e+159) {
tmp = ((a * b) / (y_45_scale / -4.0)) / (y_45_scale * (x_45_scale_m / ((a * b) / x_45_scale_m)));
} else {
tmp = b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a));
}
return tmp;
}
x-scale_m = math.fabs(x_45_scale) def code(a, b, angle, x_45_scale_m, y_45_scale): tmp = 0 if x_45_scale_m <= 5.5e-95: tmp = (a / (y_45_scale / -4.0)) / ((x_45_scale_m * y_45_scale) / (b / (x_45_scale_m / (a * b)))) elif x_45_scale_m <= 4.8e+159: tmp = ((a * b) / (y_45_scale / -4.0)) / (y_45_scale * (x_45_scale_m / ((a * b) / x_45_scale_m))) else: tmp = b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a)) return tmp
x-scale_m = abs(x_45_scale) function code(a, b, angle, x_45_scale_m, y_45_scale) tmp = 0.0 if (x_45_scale_m <= 5.5e-95) tmp = Float64(Float64(a / Float64(y_45_scale / -4.0)) / Float64(Float64(x_45_scale_m * y_45_scale) / Float64(b / Float64(x_45_scale_m / Float64(a * b))))); elseif (x_45_scale_m <= 4.8e+159) tmp = Float64(Float64(Float64(a * b) / Float64(y_45_scale / -4.0)) / Float64(y_45_scale * Float64(x_45_scale_m / Float64(Float64(a * b) / x_45_scale_m)))); else tmp = Float64(b * Float64(Float64(a / Float64(Float64(x_45_scale_m * y_45_scale) / Float64(b / Float64(y_45_scale / -4.0)))) / Float64(x_45_scale_m / a))); end return tmp end
x-scale_m = abs(x_45_scale); function tmp_2 = code(a, b, angle, x_45_scale_m, y_45_scale) tmp = 0.0; if (x_45_scale_m <= 5.5e-95) tmp = (a / (y_45_scale / -4.0)) / ((x_45_scale_m * y_45_scale) / (b / (x_45_scale_m / (a * b)))); elseif (x_45_scale_m <= 4.8e+159) tmp = ((a * b) / (y_45_scale / -4.0)) / (y_45_scale * (x_45_scale_m / ((a * b) / x_45_scale_m))); else tmp = b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a)); end tmp_2 = tmp; end
x-scale_m = N[Abs[x$45$scale], $MachinePrecision] code[a_, b_, angle_, x$45$scale$95$m_, y$45$scale_] := If[LessEqual[x$45$scale$95$m, 5.5e-95], N[(N[(a / N[(y$45$scale / -4.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x$45$scale$95$m * y$45$scale), $MachinePrecision] / N[(b / N[(x$45$scale$95$m / N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale$95$m, 4.8e+159], N[(N[(N[(a * b), $MachinePrecision] / N[(y$45$scale / -4.0), $MachinePrecision]), $MachinePrecision] / N[(y$45$scale * N[(x$45$scale$95$m / N[(N[(a * b), $MachinePrecision] / x$45$scale$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(a / N[(N[(x$45$scale$95$m * y$45$scale), $MachinePrecision] / N[(b / N[(y$45$scale / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale$95$m / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x-scale_m = \left|x-scale\right|
\\
\begin{array}{l}
\mathbf{if}\;x-scale\_m \leq 5.5 \cdot 10^{-95}:\\
\;\;\;\;\frac{\frac{a}{\frac{y-scale}{-4}}}{\frac{x-scale\_m \cdot y-scale}{\frac{b}{\frac{x-scale\_m}{a \cdot b}}}}\\
\mathbf{elif}\;x-scale\_m \leq 4.8 \cdot 10^{+159}:\\
\;\;\;\;\frac{\frac{a \cdot b}{\frac{y-scale}{-4}}}{y-scale \cdot \frac{x-scale\_m}{\frac{a \cdot b}{x-scale\_m}}}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{\frac{a}{\frac{x-scale\_m \cdot y-scale}{\frac{b}{\frac{y-scale}{-4}}}}}{\frac{x-scale\_m}{a}}\\
\end{array}
\end{array}
if x-scale < 5.50000000000000003e-95Initial program 20.1%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.1%
Simplified54.1%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6468.0%
Applied egg-rr68.0%
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6482.0%
Applied egg-rr82.0%
*-commutativeN/A
clear-numN/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
clear-numN/A
associate-/l*N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-/r*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
Applied egg-rr85.4%
if 5.50000000000000003e-95 < x-scale < 4.8e159Initial program 39.6%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6462.0%
Simplified62.0%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6470.0%
Applied egg-rr70.0%
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.9%
Applied egg-rr79.9%
Applied egg-rr92.9%
if 4.8e159 < x-scale Initial program 48.8%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.0%
Simplified54.0%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6470.3%
Applied egg-rr70.3%
*-commutativeN/A
frac-timesN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
associate-*l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
frac-timesN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr73.8%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6484.9%
Applied egg-rr84.9%
Final simplification86.8%
x-scale_m = (fabs.f64 x-scale)
(FPCore (a b angle x-scale_m y-scale)
:precision binary64
(if (<= a 1.1e-166)
(/
(* a (/ (/ -4.0 y-scale) (/ x-scale_m (* b (* a b)))))
(* x-scale_m y-scale))
(if (<= a 6.6e+115)
(/
(/ -4.0 y-scale)
(* (/ (/ x-scale_m b) (* a a)) (* y-scale (/ x-scale_m b))))
(/
(* a (* (* a b) (/ (/ -4.0 y-scale) (/ x-scale_m b))))
(* x-scale_m y-scale)))))x-scale_m = fabs(x_45_scale);
double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
double tmp;
if (a <= 1.1e-166) {
tmp = (a * ((-4.0 / y_45_scale) / (x_45_scale_m / (b * (a * b))))) / (x_45_scale_m * y_45_scale);
} else if (a <= 6.6e+115) {
tmp = (-4.0 / y_45_scale) / (((x_45_scale_m / b) / (a * a)) * (y_45_scale * (x_45_scale_m / b)));
} else {
tmp = (a * ((a * b) * ((-4.0 / y_45_scale) / (x_45_scale_m / b)))) / (x_45_scale_m * y_45_scale);
}
return tmp;
}
x-scale_m = abs(x_45scale)
real(8) function code(a, b, angle, x_45scale_m, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale_m
real(8), intent (in) :: y_45scale
real(8) :: tmp
if (a <= 1.1d-166) then
tmp = (a * (((-4.0d0) / y_45scale) / (x_45scale_m / (b * (a * b))))) / (x_45scale_m * y_45scale)
else if (a <= 6.6d+115) then
tmp = ((-4.0d0) / y_45scale) / (((x_45scale_m / b) / (a * a)) * (y_45scale * (x_45scale_m / b)))
else
tmp = (a * ((a * b) * (((-4.0d0) / y_45scale) / (x_45scale_m / b)))) / (x_45scale_m * y_45scale)
end if
code = tmp
end function
x-scale_m = Math.abs(x_45_scale);
public static double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
double tmp;
if (a <= 1.1e-166) {
tmp = (a * ((-4.0 / y_45_scale) / (x_45_scale_m / (b * (a * b))))) / (x_45_scale_m * y_45_scale);
} else if (a <= 6.6e+115) {
tmp = (-4.0 / y_45_scale) / (((x_45_scale_m / b) / (a * a)) * (y_45_scale * (x_45_scale_m / b)));
} else {
tmp = (a * ((a * b) * ((-4.0 / y_45_scale) / (x_45_scale_m / b)))) / (x_45_scale_m * y_45_scale);
}
return tmp;
}
x-scale_m = math.fabs(x_45_scale) def code(a, b, angle, x_45_scale_m, y_45_scale): tmp = 0 if a <= 1.1e-166: tmp = (a * ((-4.0 / y_45_scale) / (x_45_scale_m / (b * (a * b))))) / (x_45_scale_m * y_45_scale) elif a <= 6.6e+115: tmp = (-4.0 / y_45_scale) / (((x_45_scale_m / b) / (a * a)) * (y_45_scale * (x_45_scale_m / b))) else: tmp = (a * ((a * b) * ((-4.0 / y_45_scale) / (x_45_scale_m / b)))) / (x_45_scale_m * y_45_scale) return tmp
x-scale_m = abs(x_45_scale) function code(a, b, angle, x_45_scale_m, y_45_scale) tmp = 0.0 if (a <= 1.1e-166) tmp = Float64(Float64(a * Float64(Float64(-4.0 / y_45_scale) / Float64(x_45_scale_m / Float64(b * Float64(a * b))))) / Float64(x_45_scale_m * y_45_scale)); elseif (a <= 6.6e+115) tmp = Float64(Float64(-4.0 / y_45_scale) / Float64(Float64(Float64(x_45_scale_m / b) / Float64(a * a)) * Float64(y_45_scale * Float64(x_45_scale_m / b)))); else tmp = Float64(Float64(a * Float64(Float64(a * b) * Float64(Float64(-4.0 / y_45_scale) / Float64(x_45_scale_m / b)))) / Float64(x_45_scale_m * y_45_scale)); end return tmp end
x-scale_m = abs(x_45_scale); function tmp_2 = code(a, b, angle, x_45_scale_m, y_45_scale) tmp = 0.0; if (a <= 1.1e-166) tmp = (a * ((-4.0 / y_45_scale) / (x_45_scale_m / (b * (a * b))))) / (x_45_scale_m * y_45_scale); elseif (a <= 6.6e+115) tmp = (-4.0 / y_45_scale) / (((x_45_scale_m / b) / (a * a)) * (y_45_scale * (x_45_scale_m / b))); else tmp = (a * ((a * b) * ((-4.0 / y_45_scale) / (x_45_scale_m / b)))) / (x_45_scale_m * y_45_scale); end tmp_2 = tmp; end
x-scale_m = N[Abs[x$45$scale], $MachinePrecision] code[a_, b_, angle_, x$45$scale$95$m_, y$45$scale_] := If[LessEqual[a, 1.1e-166], N[(N[(a * N[(N[(-4.0 / y$45$scale), $MachinePrecision] / N[(x$45$scale$95$m / N[(b * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale$95$m * y$45$scale), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.6e+115], N[(N[(-4.0 / y$45$scale), $MachinePrecision] / N[(N[(N[(x$45$scale$95$m / b), $MachinePrecision] / N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale * N[(x$45$scale$95$m / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(a * b), $MachinePrecision] * N[(N[(-4.0 / y$45$scale), $MachinePrecision] / N[(x$45$scale$95$m / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale$95$m * y$45$scale), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x-scale_m = \left|x-scale\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.1 \cdot 10^{-166}:\\
\;\;\;\;\frac{a \cdot \frac{\frac{-4}{y-scale}}{\frac{x-scale\_m}{b \cdot \left(a \cdot b\right)}}}{x-scale\_m \cdot y-scale}\\
\mathbf{elif}\;a \leq 6.6 \cdot 10^{+115}:\\
\;\;\;\;\frac{\frac{-4}{y-scale}}{\frac{\frac{x-scale\_m}{b}}{a \cdot a} \cdot \left(y-scale \cdot \frac{x-scale\_m}{b}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(\left(a \cdot b\right) \cdot \frac{\frac{-4}{y-scale}}{\frac{x-scale\_m}{b}}\right)}{x-scale\_m \cdot y-scale}\\
\end{array}
\end{array}
if a < 1.1000000000000001e-166Initial program 30.9%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.3%
Simplified53.3%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6468.0%
Applied egg-rr68.0%
*-commutativeN/A
clear-numN/A
un-div-invN/A
associate-*r*N/A
associate-*l*N/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6484.9%
Applied egg-rr84.9%
if 1.1000000000000001e-166 < a < 6.6000000000000001e115Initial program 30.0%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6469.9%
Simplified69.9%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6479.2%
Applied egg-rr79.2%
*-commutativeN/A
frac-timesN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
associate-*l*N/A
clear-numN/A
un-div-invN/A
clear-numN/A
un-div-invN/A
associate-/r*N/A
associate-/l/N/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
Applied egg-rr93.2%
if 6.6000000000000001e115 < a Initial program 3.0%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6439.6%
Simplified39.6%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6451.7%
Applied egg-rr51.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
associate-*r*N/A
associate-*l*N/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6465.4%
Applied egg-rr65.4%
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6473.6%
Applied egg-rr73.6%
Final simplification85.4%
x-scale_m = (fabs.f64 x-scale)
(FPCore (a b angle x-scale_m y-scale)
:precision binary64
(if (<= b 8.8e-125)
(*
b
(/ (/ a (/ (* x-scale_m y-scale) (/ b (/ y-scale -4.0)))) (/ x-scale_m a)))
(/
(/ a (/ y-scale -4.0))
(/ (* x-scale_m y-scale) (/ b (/ x-scale_m (* a b)))))))x-scale_m = fabs(x_45_scale);
double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
double tmp;
if (b <= 8.8e-125) {
tmp = b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a));
} else {
tmp = (a / (y_45_scale / -4.0)) / ((x_45_scale_m * y_45_scale) / (b / (x_45_scale_m / (a * b))));
}
return tmp;
}
x-scale_m = abs(x_45scale)
real(8) function code(a, b, angle, x_45scale_m, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale_m
real(8), intent (in) :: y_45scale
real(8) :: tmp
if (b <= 8.8d-125) then
tmp = b * ((a / ((x_45scale_m * y_45scale) / (b / (y_45scale / (-4.0d0))))) / (x_45scale_m / a))
else
tmp = (a / (y_45scale / (-4.0d0))) / ((x_45scale_m * y_45scale) / (b / (x_45scale_m / (a * b))))
end if
code = tmp
end function
x-scale_m = Math.abs(x_45_scale);
public static double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
double tmp;
if (b <= 8.8e-125) {
tmp = b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a));
} else {
tmp = (a / (y_45_scale / -4.0)) / ((x_45_scale_m * y_45_scale) / (b / (x_45_scale_m / (a * b))));
}
return tmp;
}
x-scale_m = math.fabs(x_45_scale) def code(a, b, angle, x_45_scale_m, y_45_scale): tmp = 0 if b <= 8.8e-125: tmp = b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a)) else: tmp = (a / (y_45_scale / -4.0)) / ((x_45_scale_m * y_45_scale) / (b / (x_45_scale_m / (a * b)))) return tmp
x-scale_m = abs(x_45_scale) function code(a, b, angle, x_45_scale_m, y_45_scale) tmp = 0.0 if (b <= 8.8e-125) tmp = Float64(b * Float64(Float64(a / Float64(Float64(x_45_scale_m * y_45_scale) / Float64(b / Float64(y_45_scale / -4.0)))) / Float64(x_45_scale_m / a))); else tmp = Float64(Float64(a / Float64(y_45_scale / -4.0)) / Float64(Float64(x_45_scale_m * y_45_scale) / Float64(b / Float64(x_45_scale_m / Float64(a * b))))); end return tmp end
x-scale_m = abs(x_45_scale); function tmp_2 = code(a, b, angle, x_45_scale_m, y_45_scale) tmp = 0.0; if (b <= 8.8e-125) tmp = b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a)); else tmp = (a / (y_45_scale / -4.0)) / ((x_45_scale_m * y_45_scale) / (b / (x_45_scale_m / (a * b)))); end tmp_2 = tmp; end
x-scale_m = N[Abs[x$45$scale], $MachinePrecision] code[a_, b_, angle_, x$45$scale$95$m_, y$45$scale_] := If[LessEqual[b, 8.8e-125], N[(b * N[(N[(a / N[(N[(x$45$scale$95$m * y$45$scale), $MachinePrecision] / N[(b / N[(y$45$scale / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale$95$m / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a / N[(y$45$scale / -4.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x$45$scale$95$m * y$45$scale), $MachinePrecision] / N[(b / N[(x$45$scale$95$m / N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x-scale_m = \left|x-scale\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8.8 \cdot 10^{-125}:\\
\;\;\;\;b \cdot \frac{\frac{a}{\frac{x-scale\_m \cdot y-scale}{\frac{b}{\frac{y-scale}{-4}}}}}{\frac{x-scale\_m}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{\frac{y-scale}{-4}}}{\frac{x-scale\_m \cdot y-scale}{\frac{b}{\frac{x-scale\_m}{a \cdot b}}}}\\
\end{array}
\end{array}
if b < 8.79999999999999979e-125Initial program 30.6%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.6%
Simplified55.6%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6467.9%
Applied egg-rr67.9%
*-commutativeN/A
frac-timesN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
associate-*l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
frac-timesN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr78.6%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6485.0%
Applied egg-rr85.0%
if 8.79999999999999979e-125 < b Initial program 18.1%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.6%
Simplified55.6%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6470.1%
Applied egg-rr70.1%
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.1%
Applied egg-rr80.1%
*-commutativeN/A
clear-numN/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
clear-numN/A
associate-/l*N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-/r*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
Applied egg-rr89.3%
Final simplification86.3%
x-scale_m = (fabs.f64 x-scale)
(FPCore (a b angle x-scale_m y-scale)
:precision binary64
(if (<= x-scale_m 2.35e-43)
(/
(* a (* (* a b) (/ (/ -4.0 y-scale) (/ x-scale_m b))))
(* x-scale_m y-scale))
(*
b
(/
a
(/ (/ (* x-scale_m y-scale) (/ b (/ y-scale -4.0))) (/ a x-scale_m))))))x-scale_m = fabs(x_45_scale);
double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
double tmp;
if (x_45_scale_m <= 2.35e-43) {
tmp = (a * ((a * b) * ((-4.0 / y_45_scale) / (x_45_scale_m / b)))) / (x_45_scale_m * y_45_scale);
} else {
tmp = b * (a / (((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0))) / (a / x_45_scale_m)));
}
return tmp;
}
x-scale_m = abs(x_45scale)
real(8) function code(a, b, angle, x_45scale_m, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale_m
real(8), intent (in) :: y_45scale
real(8) :: tmp
if (x_45scale_m <= 2.35d-43) then
tmp = (a * ((a * b) * (((-4.0d0) / y_45scale) / (x_45scale_m / b)))) / (x_45scale_m * y_45scale)
else
tmp = b * (a / (((x_45scale_m * y_45scale) / (b / (y_45scale / (-4.0d0)))) / (a / x_45scale_m)))
end if
code = tmp
end function
x-scale_m = Math.abs(x_45_scale);
public static double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
double tmp;
if (x_45_scale_m <= 2.35e-43) {
tmp = (a * ((a * b) * ((-4.0 / y_45_scale) / (x_45_scale_m / b)))) / (x_45_scale_m * y_45_scale);
} else {
tmp = b * (a / (((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0))) / (a / x_45_scale_m)));
}
return tmp;
}
x-scale_m = math.fabs(x_45_scale) def code(a, b, angle, x_45_scale_m, y_45_scale): tmp = 0 if x_45_scale_m <= 2.35e-43: tmp = (a * ((a * b) * ((-4.0 / y_45_scale) / (x_45_scale_m / b)))) / (x_45_scale_m * y_45_scale) else: tmp = b * (a / (((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0))) / (a / x_45_scale_m))) return tmp
x-scale_m = abs(x_45_scale) function code(a, b, angle, x_45_scale_m, y_45_scale) tmp = 0.0 if (x_45_scale_m <= 2.35e-43) tmp = Float64(Float64(a * Float64(Float64(a * b) * Float64(Float64(-4.0 / y_45_scale) / Float64(x_45_scale_m / b)))) / Float64(x_45_scale_m * y_45_scale)); else tmp = Float64(b * Float64(a / Float64(Float64(Float64(x_45_scale_m * y_45_scale) / Float64(b / Float64(y_45_scale / -4.0))) / Float64(a / x_45_scale_m)))); end return tmp end
x-scale_m = abs(x_45_scale); function tmp_2 = code(a, b, angle, x_45_scale_m, y_45_scale) tmp = 0.0; if (x_45_scale_m <= 2.35e-43) tmp = (a * ((a * b) * ((-4.0 / y_45_scale) / (x_45_scale_m / b)))) / (x_45_scale_m * y_45_scale); else tmp = b * (a / (((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0))) / (a / x_45_scale_m))); end tmp_2 = tmp; end
x-scale_m = N[Abs[x$45$scale], $MachinePrecision] code[a_, b_, angle_, x$45$scale$95$m_, y$45$scale_] := If[LessEqual[x$45$scale$95$m, 2.35e-43], N[(N[(a * N[(N[(a * b), $MachinePrecision] * N[(N[(-4.0 / y$45$scale), $MachinePrecision] / N[(x$45$scale$95$m / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale$95$m * y$45$scale), $MachinePrecision]), $MachinePrecision], N[(b * N[(a / N[(N[(N[(x$45$scale$95$m * y$45$scale), $MachinePrecision] / N[(b / N[(y$45$scale / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a / x$45$scale$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x-scale_m = \left|x-scale\right|
\\
\begin{array}{l}
\mathbf{if}\;x-scale\_m \leq 2.35 \cdot 10^{-43}:\\
\;\;\;\;\frac{a \cdot \left(\left(a \cdot b\right) \cdot \frac{\frac{-4}{y-scale}}{\frac{x-scale\_m}{b}}\right)}{x-scale\_m \cdot y-scale}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{a}{\frac{\frac{x-scale\_m \cdot y-scale}{\frac{b}{\frac{y-scale}{-4}}}}{\frac{a}{x-scale\_m}}}\\
\end{array}
\end{array}
if x-scale < 2.35e-43Initial program 21.5%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.9%
Simplified53.9%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6466.9%
Applied egg-rr66.9%
*-commutativeN/A
clear-numN/A
un-div-invN/A
associate-*r*N/A
associate-*l*N/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.2%
Applied egg-rr79.2%
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6485.4%
Applied egg-rr85.4%
if 2.35e-43 < x-scale Initial program 43.0%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.8%
Simplified60.8%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6473.6%
Applied egg-rr73.6%
*-commutativeN/A
frac-timesN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
associate-*l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
frac-timesN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr78.4%
associate-/l/N/A
/-lowering-/.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6487.5%
Applied egg-rr87.5%
Final simplification86.0%
x-scale_m = (fabs.f64 x-scale) (FPCore (a b angle x-scale_m y-scale) :precision binary64 (* b (/ (/ a (/ (* x-scale_m y-scale) (/ b (/ y-scale -4.0)))) (/ x-scale_m a))))
x-scale_m = fabs(x_45_scale);
double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
return b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a));
}
x-scale_m = abs(x_45scale)
real(8) function code(a, b, angle, x_45scale_m, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale_m
real(8), intent (in) :: y_45scale
code = b * ((a / ((x_45scale_m * y_45scale) / (b / (y_45scale / (-4.0d0))))) / (x_45scale_m / a))
end function
x-scale_m = Math.abs(x_45_scale);
public static double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
return b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a));
}
x-scale_m = math.fabs(x_45_scale) def code(a, b, angle, x_45_scale_m, y_45_scale): return b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a))
x-scale_m = abs(x_45_scale) function code(a, b, angle, x_45_scale_m, y_45_scale) return Float64(b * Float64(Float64(a / Float64(Float64(x_45_scale_m * y_45_scale) / Float64(b / Float64(y_45_scale / -4.0)))) / Float64(x_45_scale_m / a))) end
x-scale_m = abs(x_45_scale); function tmp = code(a, b, angle, x_45_scale_m, y_45_scale) tmp = b * ((a / ((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0)))) / (x_45_scale_m / a)); end
x-scale_m = N[Abs[x$45$scale], $MachinePrecision] code[a_, b_, angle_, x$45$scale$95$m_, y$45$scale_] := N[(b * N[(N[(a / N[(N[(x$45$scale$95$m * y$45$scale), $MachinePrecision] / N[(b / N[(y$45$scale / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale$95$m / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x-scale_m = \left|x-scale\right|
\\
b \cdot \frac{\frac{a}{\frac{x-scale\_m \cdot y-scale}{\frac{b}{\frac{y-scale}{-4}}}}}{\frac{x-scale\_m}{a}}
\end{array}
Initial program 26.7%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.6%
Simplified55.6%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6468.6%
Applied egg-rr68.6%
*-commutativeN/A
frac-timesN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
associate-*l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
frac-timesN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr76.1%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6484.1%
Applied egg-rr84.1%
x-scale_m = (fabs.f64 x-scale) (FPCore (a b angle x-scale_m y-scale) :precision binary64 (* b (/ a (/ (/ (* x-scale_m y-scale) (/ b (/ y-scale -4.0))) (/ a x-scale_m)))))
x-scale_m = fabs(x_45_scale);
double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
return b * (a / (((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0))) / (a / x_45_scale_m)));
}
x-scale_m = abs(x_45scale)
real(8) function code(a, b, angle, x_45scale_m, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale_m
real(8), intent (in) :: y_45scale
code = b * (a / (((x_45scale_m * y_45scale) / (b / (y_45scale / (-4.0d0)))) / (a / x_45scale_m)))
end function
x-scale_m = Math.abs(x_45_scale);
public static double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale) {
return b * (a / (((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0))) / (a / x_45_scale_m)));
}
x-scale_m = math.fabs(x_45_scale) def code(a, b, angle, x_45_scale_m, y_45_scale): return b * (a / (((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0))) / (a / x_45_scale_m)))
x-scale_m = abs(x_45_scale) function code(a, b, angle, x_45_scale_m, y_45_scale) return Float64(b * Float64(a / Float64(Float64(Float64(x_45_scale_m * y_45_scale) / Float64(b / Float64(y_45_scale / -4.0))) / Float64(a / x_45_scale_m)))) end
x-scale_m = abs(x_45_scale); function tmp = code(a, b, angle, x_45_scale_m, y_45_scale) tmp = b * (a / (((x_45_scale_m * y_45_scale) / (b / (y_45_scale / -4.0))) / (a / x_45_scale_m))); end
x-scale_m = N[Abs[x$45$scale], $MachinePrecision] code[a_, b_, angle_, x$45$scale$95$m_, y$45$scale_] := N[(b * N[(a / N[(N[(N[(x$45$scale$95$m * y$45$scale), $MachinePrecision] / N[(b / N[(y$45$scale / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a / x$45$scale$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x-scale_m = \left|x-scale\right|
\\
b \cdot \frac{a}{\frac{\frac{x-scale\_m \cdot y-scale}{\frac{b}{\frac{y-scale}{-4}}}}{\frac{a}{x-scale\_m}}}
\end{array}
Initial program 26.7%
Taylor expanded in angle around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.6%
Simplified55.6%
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6468.6%
Applied egg-rr68.6%
*-commutativeN/A
frac-timesN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
associate-*l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
frac-timesN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr76.1%
associate-/l/N/A
/-lowering-/.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6484.0%
Applied egg-rr84.0%
herbie shell --seed 2024185
(FPCore (a b angle x-scale y-scale)
:name "Simplification of discriminant from scale-rotated-ellipse"
:precision binary64
(- (* (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI))) (cos (* (/ angle 180.0) PI))) x-scale) y-scale) (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI))) (cos (* (/ angle 180.0) PI))) x-scale) y-scale)) (* (* 4.0 (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)) x-scale) x-scale)) (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) PI))) 2.0) (pow (* b (sin (* (/ angle 180.0) PI))) 2.0)) y-scale) y-scale))))