?

Average Error: 0.1 → 0.1
Time: 18.3s
Precision: binary64
Cost: 52544

?

\[\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|ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)} - \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right) \cdot \left(eh \cdot \sin 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
  (-
   (* ew (/ (cos t) (hypot 1.0 (* eh (/ (tan t) ew)))))
   (* (sin (atan (/ (* eh (- (tan t))) ew))) (* eh (sin 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(((ew * (cos(t) / hypot(1.0, (eh * (tan(t) / ew))))) - (sin(atan(((eh * -tan(t)) / ew))) * (eh * sin(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(((ew * (Math.cos(t) / Math.hypot(1.0, (eh * (Math.tan(t) / ew))))) - (Math.sin(Math.atan(((eh * -Math.tan(t)) / ew))) * (eh * Math.sin(t)))));
}
def code(eh, ew, t):
	return math.fabs((((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))))))
def code(eh, ew, t):
	return math.fabs(((ew * (math.cos(t) / math.hypot(1.0, (eh * (math.tan(t) / ew))))) - (math.sin(math.atan(((eh * -math.tan(t)) / ew))) * (eh * math.sin(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(ew * Float64(cos(t) / hypot(1.0, Float64(eh * Float64(tan(t) / ew))))) - Float64(sin(atan(Float64(Float64(eh * Float64(-tan(t))) / ew))) * Float64(eh * sin(t)))))
end
function tmp = code(eh, ew, t)
	tmp = abs((((ew * cos(t)) * cos(atan(((-eh * tan(t)) / ew)))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew))))));
end
function tmp = code(eh, ew, t)
	tmp = abs(((ew * (cos(t) / hypot(1.0, (eh * (tan(t) / ew))))) - (sin(atan(((eh * -tan(t)) / ew))) * (eh * sin(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[(ew * N[(N[Cos[t], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sin[N[ArcTan[N[(N[(eh * (-N[Tan[t], $MachinePrecision])), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * N[Sin[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|ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)} - \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right) \cdot \left(eh \cdot \sin 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-rr26.4

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

    \[\leadsto \left|\color{blue}{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\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| \]
    Proof

    [Start]26.4

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

    expm1-def [=>]15.4

    \[ \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right)\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]

    expm1-log1p [=>]0.1

    \[ \left|\color{blue}{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\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| \]
  4. Final simplification0.1

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

Alternatives

Alternative 1
Error0.7
Cost46144
\[\left|\frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}{\cos t}} - \sin \tan^{-1} \left(\frac{-t \cdot eh}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right| \]
Alternative 2
Error1.0
Cost46080
\[\left|\frac{\cos t}{\frac{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}{ew}} - \sin \tan^{-1} \left(eh \cdot \frac{t}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right| \]
Alternative 3
Error1.1
Cost39296
\[\left|ew \cdot \cos t - \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right| \]
Alternative 4
Error1.1
Cost39232
\[\left|ew \cdot \cos t - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right| \]
Alternative 5
Error1.2
Cost32896
\[\left|\sin \tan^{-1} \left(\frac{-t \cdot eh}{ew}\right) \cdot \left(eh \cdot \sin t\right) - ew \cdot \cos t\right| \]
Alternative 6
Error13.3
Cost32768
\[\left|\sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right) \cdot \left(eh \cdot \sin t\right) - ew\right| \]
Alternative 7
Error13.3
Cost26368
\[\left|ew - \sin \tan^{-1} \left(\frac{-t \cdot eh}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right| \]
Alternative 8
Error13.4
Cost13120
\[\left|eh \cdot \sin t - ew\right| \]
Alternative 9
Error43.2
Cost7104
\[\left|ew + \left(eh \cdot eh\right) \cdot \frac{t \cdot t}{ew}\right| \]
Alternative 10
Error43.2
Cost7104
\[\left|ew + \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]

Error

Reproduce?

herbie shell --seed 2023057 
(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)))))))