Average Error: 63.4 → 42.7
Time: 1.4min
Precision: binary64
Cost: 46600
\[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
\[\begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\ \mathbf{if}\;y-scale \leq -3.958808631595635 \cdot 10^{-92}:\\ \;\;\;\;\sqrt{8} \cdot \left|\left(y-scale \cdot b\right) \cdot \sqrt{0.125}\right|\\ \mathbf{elif}\;y-scale \leq 5.219162078273588 \cdot 10^{-157}:\\ \;\;\;\;-0.25 \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \left(a \cdot \left(\sqrt{8} \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \left({2}^{0.25} \cdot \left({2}^{0.25} \cdot \mathsf{hypot}\left(a \cdot \sin t_0, b \cdot \cos t_0\right)\right)\right)\\ \end{array} \]
(FPCore (a b angle x-scale y-scale)
 :precision binary64
 (/
  (-
   (sqrt
    (*
     (*
      (* 2.0 (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0)))
      (* (* b a) (* b (- a))))
     (+
      (+
       (/
        (/
         (+
          (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))
      (sqrt
       (+
        (pow
         (-
          (/
           (/
            (+
             (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))
         2.0)
        (pow
         (/
          (/
           (*
            (*
             (* 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)))))))
  (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0))))
(FPCore (a b angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* PI (* 0.005555555555555556 angle))))
   (if (<= y-scale -3.958808631595635e-92)
     (* (sqrt 8.0) (fabs (* (* y-scale b) (sqrt 0.125))))
     (if (<= y-scale 5.219162078273588e-157)
       (*
        -0.25
        (*
         x-scale
         (*
          (sqrt 2.0)
          (* a (* (sqrt 8.0) (cos (* 0.005555555555555556 (* angle PI))))))))
       (*
        (* 0.25 (* y-scale (sqrt 8.0)))
        (*
         (pow 2.0 0.25)
         (* (pow 2.0 0.25) (hypot (* a (sin t_0)) (* b (cos t_0))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	return -sqrt((((2.0 * ((4.0 * ((b * a) * (b * -a))) / pow((x_45_scale * y_45_scale), 2.0))) * ((b * a) * (b * -a))) * (((((pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((angle / 180.0) * ((double) M_PI)))), 2.0)) / x_45_scale) / x_45_scale) + (((pow((a * cos(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * sin(((angle / 180.0) * ((double) M_PI)))), 2.0)) / y_45_scale) / y_45_scale)) + sqrt((pow(((((pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((angle / 180.0) * ((double) M_PI)))), 2.0)) / x_45_scale) / x_45_scale) - (((pow((a * cos(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * sin(((angle / 180.0) * ((double) M_PI)))), 2.0)) / y_45_scale) / y_45_scale)), 2.0) + pow((((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(((angle / 180.0) * ((double) M_PI)))) * cos(((angle / 180.0) * ((double) M_PI)))) / x_45_scale) / y_45_scale), 2.0)))))) / ((4.0 * ((b * a) * (b * -a))) / pow((x_45_scale * y_45_scale), 2.0));
}
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
	double tmp;
	if (y_45_scale <= -3.958808631595635e-92) {
		tmp = sqrt(8.0) * fabs(((y_45_scale * b) * sqrt(0.125)));
	} else if (y_45_scale <= 5.219162078273588e-157) {
		tmp = -0.25 * (x_45_scale * (sqrt(2.0) * (a * (sqrt(8.0) * cos((0.005555555555555556 * (angle * ((double) M_PI))))))));
	} else {
		tmp = (0.25 * (y_45_scale * sqrt(8.0))) * (pow(2.0, 0.25) * (pow(2.0, 0.25) * hypot((a * sin(t_0)), (b * cos(t_0)))));
	}
	return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	return -Math.sqrt((((2.0 * ((4.0 * ((b * a) * (b * -a))) / Math.pow((x_45_scale * y_45_scale), 2.0))) * ((b * a) * (b * -a))) * (((((Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((angle / 180.0) * Math.PI))), 2.0)) / x_45_scale) / x_45_scale) + (((Math.pow((a * Math.cos(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.sin(((angle / 180.0) * Math.PI))), 2.0)) / y_45_scale) / y_45_scale)) + Math.sqrt((Math.pow(((((Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((angle / 180.0) * Math.PI))), 2.0)) / x_45_scale) / x_45_scale) - (((Math.pow((a * Math.cos(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.sin(((angle / 180.0) * Math.PI))), 2.0)) / y_45_scale) / y_45_scale)), 2.0) + Math.pow((((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(((angle / 180.0) * Math.PI))) * Math.cos(((angle / 180.0) * Math.PI))) / x_45_scale) / y_45_scale), 2.0)))))) / ((4.0 * ((b * a) * (b * -a))) / Math.pow((x_45_scale * y_45_scale), 2.0));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = Math.PI * (0.005555555555555556 * angle);
	double tmp;
	if (y_45_scale <= -3.958808631595635e-92) {
		tmp = Math.sqrt(8.0) * Math.abs(((y_45_scale * b) * Math.sqrt(0.125)));
	} else if (y_45_scale <= 5.219162078273588e-157) {
		tmp = -0.25 * (x_45_scale * (Math.sqrt(2.0) * (a * (Math.sqrt(8.0) * Math.cos((0.005555555555555556 * (angle * Math.PI)))))));
	} else {
		tmp = (0.25 * (y_45_scale * Math.sqrt(8.0))) * (Math.pow(2.0, 0.25) * (Math.pow(2.0, 0.25) * Math.hypot((a * Math.sin(t_0)), (b * Math.cos(t_0)))));
	}
	return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale):
	return -math.sqrt((((2.0 * ((4.0 * ((b * a) * (b * -a))) / math.pow((x_45_scale * y_45_scale), 2.0))) * ((b * a) * (b * -a))) * (((((math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(((angle / 180.0) * math.pi))), 2.0)) / x_45_scale) / x_45_scale) + (((math.pow((a * math.cos(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.sin(((angle / 180.0) * math.pi))), 2.0)) / y_45_scale) / y_45_scale)) + math.sqrt((math.pow(((((math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(((angle / 180.0) * math.pi))), 2.0)) / x_45_scale) / x_45_scale) - (((math.pow((a * math.cos(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.sin(((angle / 180.0) * math.pi))), 2.0)) / y_45_scale) / y_45_scale)), 2.0) + math.pow((((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(((angle / 180.0) * math.pi))) * math.cos(((angle / 180.0) * math.pi))) / x_45_scale) / y_45_scale), 2.0)))))) / ((4.0 * ((b * a) * (b * -a))) / math.pow((x_45_scale * y_45_scale), 2.0))
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = math.pi * (0.005555555555555556 * angle)
	tmp = 0
	if y_45_scale <= -3.958808631595635e-92:
		tmp = math.sqrt(8.0) * math.fabs(((y_45_scale * b) * math.sqrt(0.125)))
	elif y_45_scale <= 5.219162078273588e-157:
		tmp = -0.25 * (x_45_scale * (math.sqrt(2.0) * (a * (math.sqrt(8.0) * math.cos((0.005555555555555556 * (angle * math.pi)))))))
	else:
		tmp = (0.25 * (y_45_scale * math.sqrt(8.0))) * (math.pow(2.0, 0.25) * (math.pow(2.0, 0.25) * math.hypot((a * math.sin(t_0)), (b * math.cos(t_0)))))
	return tmp
function code(a, b, angle, x_45_scale, y_45_scale)
	return Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * Float64(Float64(4.0 * Float64(Float64(b * a) * Float64(b * Float64(-a)))) / (Float64(x_45_scale * y_45_scale) ^ 2.0))) * Float64(Float64(b * a) * Float64(b * Float64(-a)))) * Float64(Float64(Float64(Float64(Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale) + Float64(Float64(Float64((Float64(a * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale)) + sqrt(Float64((Float64(Float64(Float64(Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale) - Float64(Float64(Float64((Float64(a * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale)) ^ 2.0) + (Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(Float64(angle / 180.0) * pi))) * cos(Float64(Float64(angle / 180.0) * pi))) / x_45_scale) / y_45_scale) ^ 2.0))))))) / Float64(Float64(4.0 * Float64(Float64(b * a) * Float64(b * Float64(-a)))) / (Float64(x_45_scale * y_45_scale) ^ 2.0)))
end
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(pi * Float64(0.005555555555555556 * angle))
	tmp = 0.0
	if (y_45_scale <= -3.958808631595635e-92)
		tmp = Float64(sqrt(8.0) * abs(Float64(Float64(y_45_scale * b) * sqrt(0.125))));
	elseif (y_45_scale <= 5.219162078273588e-157)
		tmp = Float64(-0.25 * Float64(x_45_scale * Float64(sqrt(2.0) * Float64(a * Float64(sqrt(8.0) * cos(Float64(0.005555555555555556 * Float64(angle * pi))))))));
	else
		tmp = Float64(Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) * Float64((2.0 ^ 0.25) * Float64((2.0 ^ 0.25) * hypot(Float64(a * sin(t_0)), Float64(b * cos(t_0))))));
	end
	return tmp
end
function tmp = code(a, b, angle, x_45_scale, y_45_scale)
	tmp = -sqrt((((2.0 * ((4.0 * ((b * a) * (b * -a))) / ((x_45_scale * y_45_scale) ^ 2.0))) * ((b * a) * (b * -a))) * (((((((a * sin(((angle / 180.0) * pi))) ^ 2.0) + ((b * cos(((angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale) + (((((a * cos(((angle / 180.0) * pi))) ^ 2.0) + ((b * sin(((angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale)) + sqrt(((((((((a * sin(((angle / 180.0) * pi))) ^ 2.0) + ((b * cos(((angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale) - (((((a * cos(((angle / 180.0) * pi))) ^ 2.0) + ((b * sin(((angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale)) ^ 2.0) + ((((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(((angle / 180.0) * pi))) * cos(((angle / 180.0) * pi))) / x_45_scale) / y_45_scale) ^ 2.0)))))) / ((4.0 * ((b * a) * (b * -a))) / ((x_45_scale * y_45_scale) ^ 2.0));
end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = pi * (0.005555555555555556 * angle);
	tmp = 0.0;
	if (y_45_scale <= -3.958808631595635e-92)
		tmp = sqrt(8.0) * abs(((y_45_scale * b) * sqrt(0.125)));
	elseif (y_45_scale <= 5.219162078273588e-157)
		tmp = -0.25 * (x_45_scale * (sqrt(2.0) * (a * (sqrt(8.0) * cos((0.005555555555555556 * (angle * pi)))))));
	else
		tmp = (0.25 * (y_45_scale * sqrt(8.0))) * ((2.0 ^ 0.25) * ((2.0 ^ 0.25) * hypot((a * sin(t_0)), (b * cos(t_0)))));
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[((-N[Sqrt[N[(N[(N[(2.0 * N[(N[(4.0 * N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[(x$45$scale * y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] + N[(N[(N[(N[Power[N[(a * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(N[(N[(N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] - N[(N[(N[(N[Power[N[(a * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(4.0 * N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[(x$45$scale * y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -3.958808631595635e-92], N[(N[Sqrt[8.0], $MachinePrecision] * N[Abs[N[(N[(y$45$scale * b), $MachinePrecision] * N[Sqrt[0.125], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, 5.219162078273588e-157], N[(-0.25 * N[(x$45$scale * N[(N[Sqrt[2.0], $MachinePrecision] * N[(a * N[(N[Sqrt[8.0], $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * N[Sqrt[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}}
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
\mathbf{if}\;y-scale \leq -3.958808631595635 \cdot 10^{-92}:\\
\;\;\;\;\sqrt{8} \cdot \left|\left(y-scale \cdot b\right) \cdot \sqrt{0.125}\right|\\

\mathbf{elif}\;y-scale \leq 5.219162078273588 \cdot 10^{-157}:\\
\;\;\;\;-0.25 \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \left(a \cdot \left(\sqrt{8} \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \left({2}^{0.25} \cdot \left({2}^{0.25} \cdot \mathsf{hypot}\left(a \cdot \sin t_0, b \cdot \cos t_0\right)\right)\right)\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if y-scale < -3.9588086315956349e-92

    1. Initial program 63.0

      \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    2. Taylor expanded in angle around 0 52.3

      \[\leadsto \color{blue}{0.25 \cdot \left(\sqrt{2} \cdot \left(y-scale \cdot \left(b \cdot \sqrt{8}\right)\right)\right)} \]
    3. Simplified52.3

      \[\leadsto \color{blue}{\left(0.25 \cdot \sqrt{2}\right) \cdot \left(\left(y-scale \cdot b\right) \cdot \sqrt{8}\right)} \]
      Proof
      (*.f64 (*.f64 1/4 (sqrt.f64 2)) (*.f64 (*.f64 y-scale b) (sqrt.f64 8))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 1/4 (sqrt.f64 2)) (Rewrite<= associate-*r*_binary64 (*.f64 y-scale (*.f64 b (sqrt.f64 8))))): 35 points increase in error, 35 points decrease in error
      (Rewrite<= associate-*r*_binary64 (*.f64 1/4 (*.f64 (sqrt.f64 2) (*.f64 y-scale (*.f64 b (sqrt.f64 8)))))): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr51.3

      \[\leadsto \color{blue}{\sqrt{\left(8 \cdot {\left(y-scale \cdot b\right)}^{2}\right) \cdot 0.125}} \]
    5. Applied egg-rr51.3

      \[\leadsto \color{blue}{\sqrt{8} \cdot \sqrt{{\left(y-scale \cdot b\right)}^{2} \cdot 0.125}} \]
    6. Applied egg-rr41.2

      \[\leadsto \sqrt{8} \cdot \color{blue}{\left|\left(y-scale \cdot b\right) \cdot \sqrt{0.125}\right|} \]

    if -3.9588086315956349e-92 < y-scale < 5.21916207827358787e-157

    1. Initial program 63.8

      \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    2. Taylor expanded in a around -inf 64.0

      \[\leadsto \color{blue}{-0.25 \cdot \left(\left(y-scale \cdot \left(x-scale \cdot \left(a \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{\sqrt{4 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{y-scale}^{2} \cdot {x-scale}^{2}} + {\left(\frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{x-scale}^{2}} - \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{y-scale}^{2}}\right)}^{2}} + \left(\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{y-scale}^{2}} + \frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{x-scale}^{2}}\right)}\right)} \]
    3. Simplified64.0

      \[\leadsto \color{blue}{\left(-0.25 \cdot \left(y-scale \cdot \left(\left(x-scale \cdot a\right) \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{\sqrt{\mathsf{fma}\left(4, \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{y-scale \cdot y-scale} \cdot \frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{x-scale \cdot x-scale}, {\left(\frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{x-scale \cdot x-scale} - \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{y-scale \cdot y-scale}\right)}^{2}\right)} + \left(\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{y-scale \cdot y-scale} + \frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{x-scale \cdot x-scale}\right)}} \]
      Proof
      (*.f64 (*.f64 -1/4 (*.f64 y-scale (*.f64 (*.f64 x-scale a) (sqrt.f64 8)))) (sqrt.f64 (+.f64 (sqrt.f64 (fma.f64 4 (*.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale))) 2))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 -1/4 (*.f64 y-scale (Rewrite<= associate-*r*_binary64 (*.f64 x-scale (*.f64 a (sqrt.f64 8)))))) (sqrt.f64 (+.f64 (sqrt.f64 (fma.f64 4 (*.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale))) 2))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)))))): 8 points increase in error, 7 points decrease in error
      (*.f64 (*.f64 -1/4 (*.f64 y-scale (*.f64 x-scale (*.f64 a (sqrt.f64 8))))) (sqrt.f64 (+.f64 (sqrt.f64 (fma.f64 4 (*.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (Rewrite<= unpow2_binary64 (pow.f64 y-scale 2))) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale))) 2))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 -1/4 (*.f64 y-scale (*.f64 x-scale (*.f64 a (sqrt.f64 8))))) (sqrt.f64 (+.f64 (sqrt.f64 (fma.f64 4 (*.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 y-scale 2)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (Rewrite<= unpow2_binary64 (pow.f64 x-scale 2)))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale))) 2))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 -1/4 (*.f64 y-scale (*.f64 x-scale (*.f64 a (sqrt.f64 8))))) (sqrt.f64 (+.f64 (sqrt.f64 (fma.f64 4 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale))) 2))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 -1/4 (*.f64 y-scale (*.f64 x-scale (*.f64 a (sqrt.f64 8))))) (sqrt.f64 (+.f64 (sqrt.f64 (fma.f64 4 (/.f64 (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (Rewrite<= unpow2_binary64 (pow.f64 x-scale 2))) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale))) 2))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 -1/4 (*.f64 y-scale (*.f64 x-scale (*.f64 a (sqrt.f64 8))))) (sqrt.f64 (+.f64 (sqrt.f64 (fma.f64 4 (/.f64 (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 x-scale 2)) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (Rewrite<= unpow2_binary64 (pow.f64 y-scale 2)))) 2))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 -1/4 (*.f64 y-scale (*.f64 x-scale (*.f64 a (sqrt.f64 8))))) (sqrt.f64 (+.f64 (sqrt.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 4 (/.f64 (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 x-scale 2)) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 y-scale 2))) 2)))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 y-scale y-scale)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 -1/4 (*.f64 y-scale (*.f64 x-scale (*.f64 a (sqrt.f64 8))))) (sqrt.f64 (+.f64 (sqrt.f64 (+.f64 (*.f64 4 (/.f64 (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 x-scale 2)) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 y-scale 2))) 2))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (Rewrite<= unpow2_binary64 (pow.f64 y-scale 2))) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 x-scale x-scale)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 -1/4 (*.f64 y-scale (*.f64 x-scale (*.f64 a (sqrt.f64 8))))) (sqrt.f64 (+.f64 (sqrt.f64 (+.f64 (*.f64 4 (/.f64 (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 x-scale 2)) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 y-scale 2))) 2))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 y-scale 2)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (Rewrite<= unpow2_binary64 (pow.f64 x-scale 2))))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r*_binary64 (*.f64 -1/4 (*.f64 (*.f64 y-scale (*.f64 x-scale (*.f64 a (sqrt.f64 8)))) (sqrt.f64 (+.f64 (sqrt.f64 (+.f64 (*.f64 4 (/.f64 (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)))) (pow.f64 (-.f64 (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 x-scale 2)) (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 y-scale 2))) 2))) (+.f64 (/.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 y-scale 2)) (/.f64 (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 x-scale 2)))))))): 0 points increase in error, 0 points decrease in error
    4. Taylor expanded in y-scale around 0 48.9

      \[\leadsto \color{blue}{-0.25 \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \left(a \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sqrt{8}\right)\right)\right)\right)} \]

    if 5.21916207827358787e-157 < y-scale

    1. Initial program 63.4

      \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    2. Taylor expanded in x-scale around 0 48.4

      \[\leadsto \color{blue}{0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right) + 2 \cdot \left({\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {b}^{2}\right)}\right)} \]
    3. Simplified48.4

      \[\leadsto \color{blue}{\left(0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left({\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}, b \cdot b, \left(a \cdot a\right) \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}} \]
      Proof
      (*.f64 (*.f64 1/4 (*.f64 y-scale (sqrt.f64 8))) (sqrt.f64 (*.f64 2 (fma.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (*.f64 b b) (*.f64 (*.f64 a a) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 1/4 (*.f64 y-scale (sqrt.f64 8))) (sqrt.f64 (*.f64 2 (fma.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (Rewrite<= unpow2_binary64 (pow.f64 b 2)) (*.f64 (*.f64 a a) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 1/4 (*.f64 y-scale (sqrt.f64 8))) (sqrt.f64 (*.f64 2 (fma.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 b 2) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 a 2)) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 1/4 (*.f64 y-scale (sqrt.f64 8))) (sqrt.f64 (*.f64 2 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 b 2)) (*.f64 (pow.f64 a 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2))))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 1/4 (*.f64 y-scale (sqrt.f64 8))) (sqrt.f64 (*.f64 2 (Rewrite=> +-commutative_binary64 (+.f64 (*.f64 (pow.f64 a 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2)) (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 b 2))))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 1/4 (*.f64 y-scale (sqrt.f64 8))) (sqrt.f64 (Rewrite<= distribute-lft-out_binary64 (+.f64 (*.f64 2 (*.f64 (pow.f64 a 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2))) (*.f64 2 (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 b 2))))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r*_binary64 (*.f64 1/4 (*.f64 (*.f64 y-scale (sqrt.f64 8)) (sqrt.f64 (+.f64 (*.f64 2 (*.f64 (pow.f64 a 2) (pow.f64 (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2))) (*.f64 2 (*.f64 (pow.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) 2) (pow.f64 b 2)))))))): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr61.8

      \[\leadsto \left(0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\log \left(1 + \mathsf{expm1}\left(\sqrt{2} \cdot \mathsf{hypot}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot a, \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b\right)\right)\right)} \]
    5. Applied egg-rr37.8

      \[\leadsto \left(0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\left({2}^{0.25} \cdot \left({2}^{0.25} \cdot \mathsf{hypot}\left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot a, \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot b\right)\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;y-scale \leq -3.958808631595635 \cdot 10^{-92}:\\ \;\;\;\;\sqrt{8} \cdot \left|\left(y-scale \cdot b\right) \cdot \sqrt{0.125}\right|\\ \mathbf{elif}\;y-scale \leq 5.219162078273588 \cdot 10^{-157}:\\ \;\;\;\;-0.25 \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \left(a \cdot \left(\sqrt{8} \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \left({2}^{0.25} \cdot \left({2}^{0.25} \cdot \mathsf{hypot}\left(a \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right), b \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error51.0
Cost1108
\[\begin{array}{l} t_0 := \sqrt{8} \cdot \left(\sqrt{2} \cdot a\right)\\ t_1 := y-scale \cdot \left(-b\right)\\ \mathbf{if}\;y-scale \leq -3.3 \cdot 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y-scale \leq -3.958808631595635 \cdot 10^{-92}:\\ \;\;\;\;y-scale \cdot b\\ \mathbf{elif}\;y-scale \leq 2.2218473399535975 \cdot 10^{-183}:\\ \;\;\;\;x-scale \cdot \left(-0.25 \cdot t_0\right)\\ \mathbf{elif}\;y-scale \leq 342822469706376.06:\\ \;\;\;\;0.25 \cdot \left(x-scale \cdot t_0\right)\\ \mathbf{elif}\;y-scale \leq 8 \cdot 10^{+114}:\\ \;\;\;\;\left(y-scale \cdot b + 1\right) + -1\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]

Error

Reproduce

herbie shell --seed 2022291 
(FPCore (a b angle x-scale y-scale)
  :name "a from scale-rotated-ellipse"
  :precision binary64
  (/ (- (sqrt (* (* (* 2.0 (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0))) (* (* b a) (* b (- a)))) (+ (+ (/ (/ (+ (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)) (sqrt (+ (pow (- (/ (/ (+ (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)) 2.0) (pow (/ (/ (* (* (* 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))))))) (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0))))