Linear.Quaternion:$csin from linear-1.19.1.3

?

Percentage Accurate: 100.0% → 100.0%
Time: 22.7s
Precision: binary64
Cost: 13120

?

\[\cos x \cdot \frac{\sinh y}{y} \]
\[\cos x \cdot \frac{\sinh y}{y} \]
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y)))
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y)))
double code(double x, double y) {
	return cos(x) * (sinh(y) / y);
}
double code(double x, double y) {
	return cos(x) * (sinh(y) / y);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = cos(x) * (sinh(y) / y)
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = cos(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
	return Math.cos(x) * (Math.sinh(y) / y);
}
public static double code(double x, double y) {
	return Math.cos(x) * (Math.sinh(y) / y);
}
def code(x, y):
	return math.cos(x) * (math.sinh(y) / y)
def code(x, y):
	return math.cos(x) * (math.sinh(y) / y)
function code(x, y)
	return Float64(cos(x) * Float64(sinh(y) / y))
end
function code(x, y)
	return Float64(cos(x) * Float64(sinh(y) / y))
end
function tmp = code(x, y)
	tmp = cos(x) * (sinh(y) / y);
end
function tmp = code(x, y)
	tmp = cos(x) * (sinh(y) / y);
end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\cos x \cdot \frac{\sinh y}{y}
\cos x \cdot \frac{\sinh y}{y}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 17 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 100.0%

    \[\cos x \cdot \frac{\sinh y}{y} \]
  2. Final simplification100.0%

    \[\leadsto \cos x \cdot \frac{\sinh y}{y} \]

Alternatives

Alternative 1
Accuracy100.0%
Cost13120
\[\cos x \cdot \frac{\sinh y}{y} \]
Alternative 2
Accuracy97.9%
Cost13636
\[\begin{array}{l} t_0 := \frac{\sinh y}{y}\\ \mathbf{if}\;t_0 \leq 50:\\ \;\;\;\;\cos x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Accuracy97.6%
Cost13252
\[\begin{array}{l} t_0 := \frac{\sinh y}{y}\\ \mathbf{if}\;t_0 \leq 1.0000001:\\ \;\;\;\;\cos x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Accuracy94.2%
Cost6464
\[\cos x \]
Alternative 5
Accuracy52.7%
Cost448
\[0.16666666666666666 \cdot \left(y \cdot y\right) + 1 \]
Alternative 6
Accuracy52.4%
Cost192
\[\frac{y}{y} \]
Alternative 7
Accuracy5.3%
Cost64
\[-3 \]
Alternative 8
Accuracy6.3%
Cost64
\[-1 \]
Alternative 9
Accuracy10.6%
Cost64
\[0.004629629629629629 \]
Alternative 10
Accuracy11.3%
Cost64
\[0.027777777777777776 \]
Alternative 11
Accuracy11.8%
Cost64
\[0.0625 \]
Alternative 12
Accuracy12.3%
Cost64
\[0.125 \]
Alternative 13
Accuracy12.5%
Cost64
\[0.16666666666666666 \]
Alternative 14
Accuracy13.0%
Cost64
\[0.25 \]
Alternative 15
Accuracy13.3%
Cost64
\[0.3333333333333333 \]
Alternative 16
Accuracy14.1%
Cost64
\[0.5 \]
Alternative 17
Accuracy15.9%
Cost64
\[1.1666666666666667 \]

Reproduce?

herbie shell --seed 2023277 
(FPCore (x y)
  :name "Linear.Quaternion:$csin from linear-1.19.1.3"
  :precision binary64
  (* (cos x) (/ (sinh y) y)))