Average Error: 14.4 → 0.2
Time: 10.9s
Precision: binary64
Cost: 13120
\[\frac{\sin x \cdot \sinh y}{x} \]
\[\sin x \cdot \frac{\sinh y}{x} \]
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) x)))
double code(double x, double y) {
	return (sin(x) * sinh(y)) / x;
}
double code(double x, double y) {
	return sin(x) * (sinh(y) / x);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (sin(x) * sinh(y)) / x
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sin(x) * (sinh(y) / x)
end function
public static double code(double x, double y) {
	return (Math.sin(x) * Math.sinh(y)) / x;
}
public static double code(double x, double y) {
	return Math.sin(x) * (Math.sinh(y) / x);
}
def code(x, y):
	return (math.sin(x) * math.sinh(y)) / x
def code(x, y):
	return math.sin(x) * (math.sinh(y) / x)
function code(x, y)
	return Float64(Float64(sin(x) * sinh(y)) / x)
end
function code(x, y)
	return Float64(sin(x) * Float64(sinh(y) / x))
end
function tmp = code(x, y)
	tmp = (sin(x) * sinh(y)) / x;
end
function tmp = code(x, y)
	tmp = sin(x) * (sinh(y) / x);
end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\frac{\sin x \cdot \sinh y}{x}
\sin x \cdot \frac{\sinh y}{x}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.4
Target0.2
Herbie0.2
\[\sin x \cdot \frac{\sinh y}{x} \]

Derivation

  1. Initial program 14.4

    \[\frac{\sin x \cdot \sinh y}{x} \]
  2. Simplified0.2

    \[\leadsto \color{blue}{\sin x \cdot \frac{\sinh y}{x}} \]
    Proof
    (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) x)): 0 points increase in error, 0 points decrease in error
    (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)): 74 points increase in error, 19 points decrease in error
  3. Final simplification0.2

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

Alternatives

Alternative 1
Error1.1
Cost7232
\[\sin x \cdot \left(\frac{y}{x} \cdot \left(1 + \left(y \cdot y\right) \cdot 0.16666666666666666\right)\right) \]
Alternative 2
Error1.4
Cost6720
\[\sin x \cdot \frac{y}{x} \]
Alternative 3
Error1.3
Cost6720
\[\frac{y}{\frac{x}{\sin x}} \]
Alternative 4
Error1.3
Cost6720
\[y \cdot \frac{\sin x}{x} \]
Alternative 5
Error16.9
Cost1224
\[\begin{array}{l} t_0 := \frac{1 + \left(y + -1\right) \cdot \left(1 - y\right)}{1 + \left(1 - y\right)}\\ \mathbf{if}\;x \leq -1621850700.7656224:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 7.505613740542045 \cdot 10^{+19}:\\ \;\;\;\;y + x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error16.9
Cost840
\[\begin{array}{l} t_0 := 1 + \left(y + -1\right)\\ \mathbf{if}\;x \leq -1621850700.7656224:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 7.505613740542045 \cdot 10^{+19}:\\ \;\;\;\;y + x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error17.1
Cost584
\[\begin{array}{l} t_0 := 1 + \left(y + -1\right)\\ \mathbf{if}\;x \leq -19848046.03469217:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.666598580482247:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error18.3
Cost448
\[x \cdot \left(y \cdot \frac{1}{x}\right) \]
Alternative 9
Error31.3
Cost64
\[y \]

Error

Reproduce

herbie shell --seed 2022308 
(FPCore (x y)
  :name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (* (sin x) (/ (sinh y) x))

  (/ (* (sin x) (sinh y)) x))