Average Error: 0.1 → 0.1
Time: 13.7s
Precision: binary64
Cost: 65408
\[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
\[\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right) - \sqrt[3]{{\left(\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)\right)}^{-3}} \cdot \left(ew \cdot \cos t\right)\right| \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (-
   (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew))))
   (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (-
   (* (* eh (sin t)) (sin (atan (/ (* (tan t) (- eh)) ew))))
   (* (cbrt (pow (hypot 1.0 (* (/ eh ew) (tan t))) -3.0)) (* ew (cos t))))))
double code(double eh, double ew, double t) {
	return fabs((((ew * cos(t)) * cos(atan(((-eh * tan(t)) / ew)))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew))))));
}
double code(double eh, double ew, double t) {
	return fabs((((eh * sin(t)) * sin(atan(((tan(t) * -eh) / ew)))) - (cbrt(pow(hypot(1.0, ((eh / ew) * tan(t))), -3.0)) * (ew * cos(t)))));
}
public static double code(double eh, double ew, double t) {
	return Math.abs((((ew * Math.cos(t)) * Math.cos(Math.atan(((-eh * Math.tan(t)) / ew)))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((-eh * Math.tan(t)) / ew))))));
}
public static double code(double eh, double ew, double t) {
	return Math.abs((((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * -eh) / ew)))) - (Math.cbrt(Math.pow(Math.hypot(1.0, ((eh / ew) * Math.tan(t))), -3.0)) * (ew * Math.cos(t)))));
}
function code(eh, ew, t)
	return abs(Float64(Float64(Float64(ew * cos(t)) * cos(atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))))))
end
function code(eh, ew, t)
	return abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * Float64(-eh)) / ew)))) - Float64(cbrt((hypot(1.0, Float64(Float64(eh / ew) * tan(t))) ^ -3.0)) * Float64(ew * cos(t)))))
end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Power[N[Power[N[Sqrt[1.0 ^ 2 + N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], -3.0], $MachinePrecision], 1/3], $MachinePrecision] * N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|
\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right) - \sqrt[3]{{\left(\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)\right)}^{-3}} \cdot \left(ew \cdot \cos t\right)\right|

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Applied egg-rr0.1

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\sqrt[3]{{\left(\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)\right)}^{-3}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  3. Final simplification0.1

    \[\leadsto \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right) - \sqrt[3]{{\left(\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)\right)}^{-3}} \cdot \left(ew \cdot \cos t\right)\right| \]

Alternatives

Alternative 1
Error0.1
Cost59008
\[\left|\mathsf{fma}\left(ew, \cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)}, \sin \tan^{-1} \left(\frac{-\tan t}{\frac{ew}{eh}}\right) \cdot \left(eh \cdot \left(-\sin t\right)\right)\right)\right| \]
Alternative 2
Error0.1
Cost52672
\[\left|\frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)} \cdot \left(ew \cdot \cos t\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right)\right| \]
Alternative 3
Error0.6
Cost52544
\[\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right) - \cos \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right) \cdot \left(ew \cdot \cos t\right)\right| \]
Alternative 4
Error1.1
Cost39296
\[\left|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right)\right| \]
Alternative 5
Error1.1
Cost39232
\[\left|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right| \]
Alternative 6
Error1.2
Cost32896
\[\left|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right| \]
Alternative 7
Error13.1
Cost26368
\[\left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right| \]

Error

Reproduce

herbie shell --seed 2022328 
(FPCore (eh ew t)
  :name "Example 2 from Robby"
  :precision binary64
  (fabs (- (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))