Linear.Quaternion:$csin from linear-1.19.1.3

Percentage Accurate: 100.0% → 100.0%
Time: 42.1s
Alternatives: 13
Speedup: 1.0×

Specification

?
\[\cos x \cdot \frac{\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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    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);
}
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 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]
\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.

Accuracy vs Speed?

Herbie found 13 alternatives:

AlternativeAccuracySpeedup
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.

Initial Program: 100.0% accurate, 1.0× speedup?

\[\cos x \cdot \frac{\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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    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);
}
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 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]
\cos x \cdot \frac{\sinh y}{y}

Alternative 1: 98.6% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := \frac{\sinh y}{y}\\ t_1 := \cos x \cdot t\_0\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right)\\ \mathbf{elif}\;t\_1 \leq \frac{9007199254740991}{9007199254740992}:\\ \;\;\;\;\cos x \cdot \frac{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right) - 1}{\left(y \cdot y\right) \cdot \frac{1}{6} - 1}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_0\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (/ (sinh y) y)) (t_1 (* (cos x) t_0)))
  (if (<= t_1 (- INFINITY))
    (*
     (+ 1 (* -1/2 (pow x 2)))
     (- (* (sqrt (* (* (* y y) y) y)) 1/6) -1))
    (if (<= t_1 9007199254740991/9007199254740992)
      (*
       (cos x)
       (/ (- (* (* 1/36 (* y y)) (* y y)) 1) (- (* (* y y) 1/6) 1)))
      (* 1 t_0)))))
double code(double x, double y) {
	double t_0 = sinh(y) / y;
	double t_1 = cos(x) * t_0;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (1.0 + (-0.5 * pow(x, 2.0))) * ((sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0);
	} else if (t_1 <= 0.9999999999999999) {
		tmp = cos(x) * ((((0.027777777777777776 * (y * y)) * (y * y)) - 1.0) / (((y * y) * 0.16666666666666666) - 1.0));
	} else {
		tmp = 1.0 * t_0;
	}
	return tmp;
}
public static double code(double x, double y) {
	double t_0 = Math.sinh(y) / y;
	double t_1 = Math.cos(x) * t_0;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = (1.0 + (-0.5 * Math.pow(x, 2.0))) * ((Math.sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0);
	} else if (t_1 <= 0.9999999999999999) {
		tmp = Math.cos(x) * ((((0.027777777777777776 * (y * y)) * (y * y)) - 1.0) / (((y * y) * 0.16666666666666666) - 1.0));
	} else {
		tmp = 1.0 * t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = math.sinh(y) / y
	t_1 = math.cos(x) * t_0
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (1.0 + (-0.5 * math.pow(x, 2.0))) * ((math.sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0)
	elif t_1 <= 0.9999999999999999:
		tmp = math.cos(x) * ((((0.027777777777777776 * (y * y)) * (y * y)) - 1.0) / (((y * y) * 0.16666666666666666) - 1.0))
	else:
		tmp = 1.0 * t_0
	return tmp
function code(x, y)
	t_0 = Float64(sinh(y) / y)
	t_1 = Float64(cos(x) * t_0)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(1.0 + Float64(-0.5 * (x ^ 2.0))) * Float64(Float64(sqrt(Float64(Float64(Float64(y * y) * y) * y)) * 0.16666666666666666) - -1.0));
	elseif (t_1 <= 0.9999999999999999)
		tmp = Float64(cos(x) * Float64(Float64(Float64(Float64(0.027777777777777776 * Float64(y * y)) * Float64(y * y)) - 1.0) / Float64(Float64(Float64(y * y) * 0.16666666666666666) - 1.0)));
	else
		tmp = Float64(1.0 * t_0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = sinh(y) / y;
	t_1 = cos(x) * t_0;
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (1.0 + (-0.5 * (x ^ 2.0))) * ((sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0);
	elseif (t_1 <= 0.9999999999999999)
		tmp = cos(x) * ((((0.027777777777777776 * (y * y)) * (y * y)) - 1.0) / (((y * y) * 0.16666666666666666) - 1.0));
	else
		tmp = 1.0 * t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(1 + N[(-1/2 * N[Power[x, 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision] * 1/6), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 9007199254740991/9007199254740992], N[(N[Cos[x], $MachinePrecision] * N[(N[(N[(N[(1/36 * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision] / N[(N[(N[(y * y), $MachinePrecision] * 1/6), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{\sinh y}{y}\\
t_1 := \cos x \cdot t\_0\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right)\\

\mathbf{elif}\;t\_1 \leq \frac{9007199254740991}{9007199254740992}:\\
\;\;\;\;\cos x \cdot \frac{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right) - 1}{\left(y \cdot y\right) \cdot \frac{1}{6} - 1}\\

\mathbf{else}:\\
\;\;\;\;1 \cdot t\_0\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
      3. lower-pow.f6477.5%

        \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
    4. Applied rewrites77.5%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
      2. +-commutativeN/A

        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
      3. add-flipN/A

        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
      5. lower--.f6477.5%

        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
      7. *-commutativeN/A

        \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
      8. lower-*.f6477.5%

        \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
      9. lift-pow.f64N/A

        \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
      10. unpow2N/A

        \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      11. lower-*.f6477.5%

        \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
    6. Applied rewrites77.5%

      \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]
    7. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
    8. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      3. lower-pow.f6450.5%

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
    9. Applied rewrites50.5%

      \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
    10. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\left(\sqrt{y \cdot y} \cdot \sqrt{y \cdot y}\right) \cdot \frac{1}{6} - -1\right) \]
      2. sqrt-unprodN/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \frac{1}{6} - -1\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \frac{1}{6} - -1\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \frac{1}{6} - -1\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
      7. pow3N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{{y}^{3} \cdot y} \cdot \frac{1}{6} - -1\right) \]
      8. cube-unmultN/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
      10. lower-*.f64N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
      11. lift-*.f64N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
      12. cube-unmultN/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{{y}^{3} \cdot y} \cdot \frac{1}{6} - -1\right) \]
      13. pow3N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
      14. lift-*.f64N/A

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
      15. lower-*.f6456.3%

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
    11. Applied rewrites56.3%

      \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]

    if -inf.0 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < 0.99999999999999989

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
      3. lower-pow.f6477.5%

        \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
    4. Applied rewrites77.5%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
      2. +-commutativeN/A

        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
      3. flip-+N/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\color{blue}{\frac{1}{6} \cdot {y}^{2} - 1}} \]
      4. lower-unsound-/.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\color{blue}{\frac{1}{6} \cdot {y}^{2} - 1}} \]
      5. lower-unsound--.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\color{blue}{\frac{1}{6} \cdot {y}^{2}} - 1} \]
      6. lower-unsound-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\color{blue}{\frac{1}{6}} \cdot {y}^{2} - 1} \]
      7. lift-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      8. *-commutativeN/A

        \[\leadsto \cos x \cdot \frac{\left({y}^{2} \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      9. lower-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left({y}^{2} \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      10. lift-pow.f64N/A

        \[\leadsto \cos x \cdot \frac{\left({y}^{2} \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      11. unpow2N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      12. lower-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      13. lift-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      14. *-commutativeN/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left({y}^{2} \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      15. lower-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left({y}^{2} \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      16. lift-pow.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left({y}^{2} \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      17. unpow2N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      18. lower-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
      19. lower-unsound-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot \color{blue}{{y}^{2}} - 1} \]
      20. lower-unsound--.f6462.6%

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - \color{blue}{1}} \]
    6. Applied rewrites62.6%

      \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\color{blue}{\left(y \cdot y\right) \cdot \frac{1}{6} - 1}} \]
    7. Step-by-step derivation
      1. lower-unsound-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\left(y \cdot y\right) \cdot \color{blue}{\frac{1}{6}} - 1} \]
      2. lift-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\color{blue}{\left(y \cdot y\right)} \cdot \frac{1}{6} - 1} \]
      3. lift-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\left(\color{blue}{y} \cdot y\right) \cdot \frac{1}{6} - 1} \]
      4. associate-*l*N/A

        \[\leadsto \cos x \cdot \frac{\left(y \cdot y\right) \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) - 1 \cdot 1}{\color{blue}{\left(y \cdot y\right)} \cdot \frac{1}{6} - 1} \]
      5. *-commutativeN/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(y \cdot y\right) - 1 \cdot 1}{\color{blue}{\left(y \cdot y\right)} \cdot \frac{1}{6} - 1} \]
      6. lower-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(y \cdot y\right) - 1 \cdot 1}{\color{blue}{\left(y \cdot y\right)} \cdot \frac{1}{6} - 1} \]
      7. lift-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(y \cdot y\right) - 1 \cdot 1}{\left(y \cdot y\right) \cdot \frac{1}{6} - 1} \]
      8. *-commutativeN/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot \left(\frac{1}{6} \cdot \left(y \cdot y\right)\right)\right) \cdot \left(y \cdot y\right) - 1 \cdot 1}{\left(y \cdot y\right) \cdot \frac{1}{6} - 1} \]
      9. associate-*r*N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(\frac{1}{6} \cdot \frac{1}{6}\right) \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right) - 1 \cdot 1}{\left(\color{blue}{y} \cdot y\right) \cdot \frac{1}{6} - 1} \]
      10. lower-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\left(\frac{1}{6} \cdot \frac{1}{6}\right) \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right) - 1 \cdot 1}{\left(\color{blue}{y} \cdot y\right) \cdot \frac{1}{6} - 1} \]
      11. metadata-evalN/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right) - 1 \cdot 1}{\left(y \cdot y\right) \cdot \frac{1}{6} - 1} \]
      12. lower-unsound-*.f6462.6%

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right) - 1 \cdot 1}{\left(y \cdot y\right) \cdot \color{blue}{\frac{1}{6}} - 1} \]
      13. lift-*.f64N/A

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right) - 1 \cdot 1}{\left(y \cdot y\right) \cdot \color{blue}{\frac{1}{6}} - 1} \]
      14. metadata-eval62.6%

        \[\leadsto \cos x \cdot \frac{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right) - 1}{\left(y \cdot y\right) \cdot \color{blue}{\frac{1}{6}} - 1} \]
    8. Applied rewrites62.6%

      \[\leadsto \cos x \cdot \frac{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right) - 1}{\color{blue}{\left(y \cdot y\right) \cdot \frac{1}{6}} - 1} \]

    if 0.99999999999999989 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y))

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in x around 0

      \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
    3. Step-by-step derivation
      1. Applied rewrites64.4%

        \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
    4. Recombined 3 regimes into one program.
    5. Add Preprocessing

    Alternative 2: 98.6% accurate, 0.3× speedup?

    \[\begin{array}{l} t_0 := \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)\\ t_1 := \frac{\sinh y}{y}\\ t_2 := \cos x \cdot t\_1\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;\left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right)\\ \mathbf{elif}\;t\_2 \leq \frac{9007199254740991}{9007199254740992}:\\ \;\;\;\;\cos x \cdot \frac{\sqrt{t\_0 \cdot t\_0} - 1 \cdot 1}{\left(y \cdot y\right) \cdot \frac{1}{6} - 1}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_1\\ \end{array} \]
    (FPCore (x y)
      :precision binary64
      (let* ((t_0 (* (* 1/36 (* y y)) (* y y)))
           (t_1 (/ (sinh y) y))
           (t_2 (* (cos x) t_1)))
      (if (<= t_2 (- INFINITY))
        (*
         (+ 1 (* -1/2 (pow x 2)))
         (- (* (sqrt (* (* (* y y) y) y)) 1/6) -1))
        (if (<= t_2 9007199254740991/9007199254740992)
          (*
           (cos x)
           (/ (- (sqrt (* t_0 t_0)) (* 1 1)) (- (* (* y y) 1/6) 1)))
          (* 1 t_1)))))
    double code(double x, double y) {
    	double t_0 = (0.027777777777777776 * (y * y)) * (y * y);
    	double t_1 = sinh(y) / y;
    	double t_2 = cos(x) * t_1;
    	double tmp;
    	if (t_2 <= -((double) INFINITY)) {
    		tmp = (1.0 + (-0.5 * pow(x, 2.0))) * ((sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0);
    	} else if (t_2 <= 0.9999999999999999) {
    		tmp = cos(x) * ((sqrt((t_0 * t_0)) - (1.0 * 1.0)) / (((y * y) * 0.16666666666666666) - 1.0));
    	} else {
    		tmp = 1.0 * t_1;
    	}
    	return tmp;
    }
    
    public static double code(double x, double y) {
    	double t_0 = (0.027777777777777776 * (y * y)) * (y * y);
    	double t_1 = Math.sinh(y) / y;
    	double t_2 = Math.cos(x) * t_1;
    	double tmp;
    	if (t_2 <= -Double.POSITIVE_INFINITY) {
    		tmp = (1.0 + (-0.5 * Math.pow(x, 2.0))) * ((Math.sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0);
    	} else if (t_2 <= 0.9999999999999999) {
    		tmp = Math.cos(x) * ((Math.sqrt((t_0 * t_0)) - (1.0 * 1.0)) / (((y * y) * 0.16666666666666666) - 1.0));
    	} else {
    		tmp = 1.0 * t_1;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	t_0 = (0.027777777777777776 * (y * y)) * (y * y)
    	t_1 = math.sinh(y) / y
    	t_2 = math.cos(x) * t_1
    	tmp = 0
    	if t_2 <= -math.inf:
    		tmp = (1.0 + (-0.5 * math.pow(x, 2.0))) * ((math.sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0)
    	elif t_2 <= 0.9999999999999999:
    		tmp = math.cos(x) * ((math.sqrt((t_0 * t_0)) - (1.0 * 1.0)) / (((y * y) * 0.16666666666666666) - 1.0))
    	else:
    		tmp = 1.0 * t_1
    	return tmp
    
    function code(x, y)
    	t_0 = Float64(Float64(0.027777777777777776 * Float64(y * y)) * Float64(y * y))
    	t_1 = Float64(sinh(y) / y)
    	t_2 = Float64(cos(x) * t_1)
    	tmp = 0.0
    	if (t_2 <= Float64(-Inf))
    		tmp = Float64(Float64(1.0 + Float64(-0.5 * (x ^ 2.0))) * Float64(Float64(sqrt(Float64(Float64(Float64(y * y) * y) * y)) * 0.16666666666666666) - -1.0));
    	elseif (t_2 <= 0.9999999999999999)
    		tmp = Float64(cos(x) * Float64(Float64(sqrt(Float64(t_0 * t_0)) - Float64(1.0 * 1.0)) / Float64(Float64(Float64(y * y) * 0.16666666666666666) - 1.0)));
    	else
    		tmp = Float64(1.0 * t_1);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	t_0 = (0.027777777777777776 * (y * y)) * (y * y);
    	t_1 = sinh(y) / y;
    	t_2 = cos(x) * t_1;
    	tmp = 0.0;
    	if (t_2 <= -Inf)
    		tmp = (1.0 + (-0.5 * (x ^ 2.0))) * ((sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0);
    	elseif (t_2 <= 0.9999999999999999)
    		tmp = cos(x) * ((sqrt((t_0 * t_0)) - (1.0 * 1.0)) / (((y * y) * 0.16666666666666666) - 1.0));
    	else
    		tmp = 1.0 * t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := Block[{t$95$0 = N[(N[(1/36 * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[x], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(1 + N[(-1/2 * N[Power[x, 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision] * 1/6), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 9007199254740991/9007199254740992], N[(N[Cos[x], $MachinePrecision] * N[(N[(N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision] - N[(1 * 1), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * y), $MachinePrecision] * 1/6), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1 * t$95$1), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    t_0 := \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)\\
    t_1 := \frac{\sinh y}{y}\\
    t_2 := \cos x \cdot t\_1\\
    \mathbf{if}\;t\_2 \leq -\infty:\\
    \;\;\;\;\left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right)\\
    
    \mathbf{elif}\;t\_2 \leq \frac{9007199254740991}{9007199254740992}:\\
    \;\;\;\;\cos x \cdot \frac{\sqrt{t\_0 \cdot t\_0} - 1 \cdot 1}{\left(y \cdot y\right) \cdot \frac{1}{6} - 1}\\
    
    \mathbf{else}:\\
    \;\;\;\;1 \cdot t\_1\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0

      1. Initial program 100.0%

        \[\cos x \cdot \frac{\sinh y}{y} \]
      2. Taylor expanded in y around 0

        \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
      3. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
        3. lower-pow.f6477.5%

          \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
      4. Applied rewrites77.5%

        \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
      5. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
        2. +-commutativeN/A

          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
        3. add-flipN/A

          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
        4. metadata-evalN/A

          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
        5. lower--.f6477.5%

          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
        7. *-commutativeN/A

          \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
        8. lower-*.f6477.5%

          \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
        9. lift-pow.f64N/A

          \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
        10. unpow2N/A

          \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
        11. lower-*.f6477.5%

          \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      6. Applied rewrites77.5%

        \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]
      7. Taylor expanded in x around 0

        \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      8. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \left(1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
        3. lower-pow.f6450.5%

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      9. Applied rewrites50.5%

        \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      10. Step-by-step derivation
        1. rem-square-sqrtN/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\left(\sqrt{y \cdot y} \cdot \sqrt{y \cdot y}\right) \cdot \frac{1}{6} - -1\right) \]
        2. sqrt-unprodN/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \frac{1}{6} - -1\right) \]
        3. lower-sqrt.f64N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \frac{1}{6} - -1\right) \]
        4. lift-*.f64N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \frac{1}{6} - -1\right) \]
        5. associate-*r*N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
        6. lift-*.f64N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
        7. pow3N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{{y}^{3} \cdot y} \cdot \frac{1}{6} - -1\right) \]
        8. cube-unmultN/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
        9. lift-*.f64N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
        10. lower-*.f64N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
        11. lift-*.f64N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
        12. cube-unmultN/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{{y}^{3} \cdot y} \cdot \frac{1}{6} - -1\right) \]
        13. pow3N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
        14. lift-*.f64N/A

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
        15. lower-*.f6456.3%

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
      11. Applied rewrites56.3%

        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]

      if -inf.0 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < 0.99999999999999989

      1. Initial program 100.0%

        \[\cos x \cdot \frac{\sinh y}{y} \]
      2. Taylor expanded in y around 0

        \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
      3. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
        3. lower-pow.f6477.5%

          \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
      4. Applied rewrites77.5%

        \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
      5. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
        2. +-commutativeN/A

          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
        3. flip-+N/A

          \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\color{blue}{\frac{1}{6} \cdot {y}^{2} - 1}} \]
        4. lower-unsound-/.f64N/A

          \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\color{blue}{\frac{1}{6} \cdot {y}^{2} - 1}} \]
        5. lower-unsound--.f64N/A

          \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\color{blue}{\frac{1}{6} \cdot {y}^{2}} - 1} \]
        6. lower-unsound-*.f64N/A

          \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\color{blue}{\frac{1}{6}} \cdot {y}^{2} - 1} \]
        7. lift-*.f64N/A

          \[\leadsto \cos x \cdot \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        8. *-commutativeN/A

          \[\leadsto \cos x \cdot \frac{\left({y}^{2} \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        9. lower-*.f64N/A

          \[\leadsto \cos x \cdot \frac{\left({y}^{2} \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        10. lift-pow.f64N/A

          \[\leadsto \cos x \cdot \frac{\left({y}^{2} \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        11. unpow2N/A

          \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        12. lower-*.f64N/A

          \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        13. lift-*.f64N/A

          \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\frac{1}{6} \cdot {y}^{2}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        14. *-commutativeN/A

          \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left({y}^{2} \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        15. lower-*.f64N/A

          \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left({y}^{2} \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        16. lift-pow.f64N/A

          \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left({y}^{2} \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        17. unpow2N/A

          \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        18. lower-*.f64N/A

          \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - 1} \]
        19. lower-unsound-*.f64N/A

          \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot \color{blue}{{y}^{2}} - 1} \]
        20. lower-unsound--.f6462.6%

          \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\frac{1}{6} \cdot {y}^{2} - \color{blue}{1}} \]
      6. Applied rewrites62.6%

        \[\leadsto \cos x \cdot \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) - 1 \cdot 1}{\color{blue}{\left(y \cdot y\right) \cdot \frac{1}{6} - 1}} \]
      7. Step-by-step derivation
        1. rem-square-sqrtN/A

          \[\leadsto \cos x \cdot \frac{\sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)} \cdot \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)} - 1 \cdot 1}{\color{blue}{\left(y \cdot y\right)} \cdot \frac{1}{6} - 1} \]
        2. sqrt-unprodN/A

          \[\leadsto \cos x \cdot \frac{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)} - 1 \cdot 1}{\color{blue}{\left(y \cdot y\right)} \cdot \frac{1}{6} - 1} \]
        3. lower-*.f32N/A

          \[\leadsto \cos x \cdot \frac{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)} - 1 \cdot 1}{\left(\color{blue}{y} \cdot y\right) \cdot \frac{1}{6} - 1} \]
        4. lower-unsound-*.f32N/A

          \[\leadsto \cos x \cdot \frac{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)} - 1 \cdot 1}{\left(\color{blue}{y} \cdot y\right) \cdot \frac{1}{6} - 1} \]
        5. lower-sqrt.f64N/A

          \[\leadsto \cos x \cdot \frac{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)} - 1 \cdot 1}{\color{blue}{\left(y \cdot y\right)} \cdot \frac{1}{6} - 1} \]
        6. lower-unsound-*.f6468.2%

          \[\leadsto \cos x \cdot \frac{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)} - 1 \cdot 1}{\left(\color{blue}{y} \cdot y\right) \cdot \frac{1}{6} - 1} \]
      8. Applied rewrites68.2%

        \[\leadsto \cos x \cdot \frac{\sqrt{\left(\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)\right) \cdot \left(\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)\right)} - 1 \cdot 1}{\color{blue}{\left(y \cdot y\right)} \cdot \frac{1}{6} - 1} \]

      if 0.99999999999999989 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y))

      1. Initial program 100.0%

        \[\cos x \cdot \frac{\sinh y}{y} \]
      2. Taylor expanded in x around 0

        \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
      3. Step-by-step derivation
        1. Applied rewrites64.4%

          \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
      4. Recombined 3 regimes into one program.
      5. Add Preprocessing

      Alternative 3: 98.6% accurate, 0.4× speedup?

      \[\begin{array}{l} t_0 := \frac{\sinh y}{y}\\ t_1 := \cos x \cdot t\_0\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right)\\ \mathbf{elif}\;t\_1 \leq \frac{9007199254740991}{9007199254740992}:\\ \;\;\;\;\cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_0\\ \end{array} \]
      (FPCore (x y)
        :precision binary64
        (let* ((t_0 (/ (sinh y) y)) (t_1 (* (cos x) t_0)))
        (if (<= t_1 (- INFINITY))
          (*
           (+ 1 (* -1/2 (pow x 2)))
           (- (* (sqrt (* (* (* y y) y) y)) 1/6) -1))
          (if (<= t_1 9007199254740991/9007199254740992)
            (* (cos x) (- (* (* y y) 1/6) -1))
            (* 1 t_0)))))
      double code(double x, double y) {
      	double t_0 = sinh(y) / y;
      	double t_1 = cos(x) * t_0;
      	double tmp;
      	if (t_1 <= -((double) INFINITY)) {
      		tmp = (1.0 + (-0.5 * pow(x, 2.0))) * ((sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0);
      	} else if (t_1 <= 0.9999999999999999) {
      		tmp = cos(x) * (((y * y) * 0.16666666666666666) - -1.0);
      	} else {
      		tmp = 1.0 * t_0;
      	}
      	return tmp;
      }
      
      public static double code(double x, double y) {
      	double t_0 = Math.sinh(y) / y;
      	double t_1 = Math.cos(x) * t_0;
      	double tmp;
      	if (t_1 <= -Double.POSITIVE_INFINITY) {
      		tmp = (1.0 + (-0.5 * Math.pow(x, 2.0))) * ((Math.sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0);
      	} else if (t_1 <= 0.9999999999999999) {
      		tmp = Math.cos(x) * (((y * y) * 0.16666666666666666) - -1.0);
      	} else {
      		tmp = 1.0 * t_0;
      	}
      	return tmp;
      }
      
      def code(x, y):
      	t_0 = math.sinh(y) / y
      	t_1 = math.cos(x) * t_0
      	tmp = 0
      	if t_1 <= -math.inf:
      		tmp = (1.0 + (-0.5 * math.pow(x, 2.0))) * ((math.sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0)
      	elif t_1 <= 0.9999999999999999:
      		tmp = math.cos(x) * (((y * y) * 0.16666666666666666) - -1.0)
      	else:
      		tmp = 1.0 * t_0
      	return tmp
      
      function code(x, y)
      	t_0 = Float64(sinh(y) / y)
      	t_1 = Float64(cos(x) * t_0)
      	tmp = 0.0
      	if (t_1 <= Float64(-Inf))
      		tmp = Float64(Float64(1.0 + Float64(-0.5 * (x ^ 2.0))) * Float64(Float64(sqrt(Float64(Float64(Float64(y * y) * y) * y)) * 0.16666666666666666) - -1.0));
      	elseif (t_1 <= 0.9999999999999999)
      		tmp = Float64(cos(x) * Float64(Float64(Float64(y * y) * 0.16666666666666666) - -1.0));
      	else
      		tmp = Float64(1.0 * t_0);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y)
      	t_0 = sinh(y) / y;
      	t_1 = cos(x) * t_0;
      	tmp = 0.0;
      	if (t_1 <= -Inf)
      		tmp = (1.0 + (-0.5 * (x ^ 2.0))) * ((sqrt((((y * y) * y) * y)) * 0.16666666666666666) - -1.0);
      	elseif (t_1 <= 0.9999999999999999)
      		tmp = cos(x) * (((y * y) * 0.16666666666666666) - -1.0);
      	else
      		tmp = 1.0 * t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_] := Block[{t$95$0 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(1 + N[(-1/2 * N[Power[x, 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision] * 1/6), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 9007199254740991/9007199254740992], N[(N[Cos[x], $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 1/6), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision], N[(1 * t$95$0), $MachinePrecision]]]]]
      
      \begin{array}{l}
      t_0 := \frac{\sinh y}{y}\\
      t_1 := \cos x \cdot t\_0\\
      \mathbf{if}\;t\_1 \leq -\infty:\\
      \;\;\;\;\left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right)\\
      
      \mathbf{elif}\;t\_1 \leq \frac{9007199254740991}{9007199254740992}:\\
      \;\;\;\;\cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;1 \cdot t\_0\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0

        1. Initial program 100.0%

          \[\cos x \cdot \frac{\sinh y}{y} \]
        2. Taylor expanded in y around 0

          \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
        3. Step-by-step derivation
          1. lower-+.f64N/A

            \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
          3. lower-pow.f6477.5%

            \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
        4. Applied rewrites77.5%

          \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
        5. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
          2. +-commutativeN/A

            \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
          3. add-flipN/A

            \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
          4. metadata-evalN/A

            \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
          5. lower--.f6477.5%

            \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
          6. lift-*.f64N/A

            \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
          7. *-commutativeN/A

            \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
          8. lower-*.f6477.5%

            \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
          9. lift-pow.f64N/A

            \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
          10. unpow2N/A

            \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
          11. lower-*.f6477.5%

            \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
        6. Applied rewrites77.5%

          \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]
        7. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
        8. Step-by-step derivation
          1. lower-+.f64N/A

            \[\leadsto \left(1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
          2. lower-*.f64N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
          3. lower-pow.f6450.5%

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
        9. Applied rewrites50.5%

          \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
        10. Step-by-step derivation
          1. rem-square-sqrtN/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\left(\sqrt{y \cdot y} \cdot \sqrt{y \cdot y}\right) \cdot \frac{1}{6} - -1\right) \]
          2. sqrt-unprodN/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \frac{1}{6} - -1\right) \]
          3. lower-sqrt.f64N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \frac{1}{6} - -1\right) \]
          4. lift-*.f64N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \frac{1}{6} - -1\right) \]
          5. associate-*r*N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
          6. lift-*.f64N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
          7. pow3N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{{y}^{3} \cdot y} \cdot \frac{1}{6} - -1\right) \]
          8. cube-unmultN/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
          9. lift-*.f64N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
          10. lower-*.f64N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
          11. lift-*.f64N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(y \cdot \left(y \cdot y\right)\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
          12. cube-unmultN/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{{y}^{3} \cdot y} \cdot \frac{1}{6} - -1\right) \]
          13. pow3N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
          14. lift-*.f64N/A

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
          15. lower-*.f6456.3%

            \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]
        11. Applied rewrites56.3%

          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\sqrt{\left(\left(y \cdot y\right) \cdot y\right) \cdot y} \cdot \frac{1}{6} - -1\right) \]

        if -inf.0 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < 0.99999999999999989

        1. Initial program 100.0%

          \[\cos x \cdot \frac{\sinh y}{y} \]
        2. Taylor expanded in y around 0

          \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
        3. Step-by-step derivation
          1. lower-+.f64N/A

            \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
          3. lower-pow.f6477.5%

            \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
        4. Applied rewrites77.5%

          \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
        5. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
          2. +-commutativeN/A

            \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
          3. add-flipN/A

            \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
          4. metadata-evalN/A

            \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
          5. lower--.f6477.5%

            \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
          6. lift-*.f64N/A

            \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
          7. *-commutativeN/A

            \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
          8. lower-*.f6477.5%

            \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
          9. lift-pow.f64N/A

            \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
          10. unpow2N/A

            \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
          11. lower-*.f6477.5%

            \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
        6. Applied rewrites77.5%

          \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]

        if 0.99999999999999989 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y))

        1. Initial program 100.0%

          \[\cos x \cdot \frac{\sinh y}{y} \]
        2. Taylor expanded in x around 0

          \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
        3. Step-by-step derivation
          1. Applied rewrites64.4%

            \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
        4. Recombined 3 regimes into one program.
        5. Add Preprocessing

        Alternative 4: 98.6% accurate, 0.4× speedup?

        \[\begin{array}{l} t_0 := \frac{\sinh y}{y}\\ t_1 := \cos x \cdot t\_0\\ t_2 := \left(y \cdot y\right) \cdot \frac{1}{6} - -1\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot t\_2\\ \mathbf{elif}\;t\_1 \leq \frac{9007199254740991}{9007199254740992}:\\ \;\;\;\;\cos x \cdot t\_2\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_0\\ \end{array} \]
        (FPCore (x y)
          :precision binary64
          (let* ((t_0 (/ (sinh y) y))
               (t_1 (* (cos x) t_0))
               (t_2 (- (* (* y y) 1/6) -1)))
          (if (<= t_1 (- INFINITY))
            (* (+ 1 (* -1/2 (sqrt (* (* x x) (* x x))))) t_2)
            (if (<= t_1 9007199254740991/9007199254740992)
              (* (cos x) t_2)
              (* 1 t_0)))))
        double code(double x, double y) {
        	double t_0 = sinh(y) / y;
        	double t_1 = cos(x) * t_0;
        	double t_2 = ((y * y) * 0.16666666666666666) - -1.0;
        	double tmp;
        	if (t_1 <= -((double) INFINITY)) {
        		tmp = (1.0 + (-0.5 * sqrt(((x * x) * (x * x))))) * t_2;
        	} else if (t_1 <= 0.9999999999999999) {
        		tmp = cos(x) * t_2;
        	} else {
        		tmp = 1.0 * t_0;
        	}
        	return tmp;
        }
        
        public static double code(double x, double y) {
        	double t_0 = Math.sinh(y) / y;
        	double t_1 = Math.cos(x) * t_0;
        	double t_2 = ((y * y) * 0.16666666666666666) - -1.0;
        	double tmp;
        	if (t_1 <= -Double.POSITIVE_INFINITY) {
        		tmp = (1.0 + (-0.5 * Math.sqrt(((x * x) * (x * x))))) * t_2;
        	} else if (t_1 <= 0.9999999999999999) {
        		tmp = Math.cos(x) * t_2;
        	} else {
        		tmp = 1.0 * t_0;
        	}
        	return tmp;
        }
        
        def code(x, y):
        	t_0 = math.sinh(y) / y
        	t_1 = math.cos(x) * t_0
        	t_2 = ((y * y) * 0.16666666666666666) - -1.0
        	tmp = 0
        	if t_1 <= -math.inf:
        		tmp = (1.0 + (-0.5 * math.sqrt(((x * x) * (x * x))))) * t_2
        	elif t_1 <= 0.9999999999999999:
        		tmp = math.cos(x) * t_2
        	else:
        		tmp = 1.0 * t_0
        	return tmp
        
        function code(x, y)
        	t_0 = Float64(sinh(y) / y)
        	t_1 = Float64(cos(x) * t_0)
        	t_2 = Float64(Float64(Float64(y * y) * 0.16666666666666666) - -1.0)
        	tmp = 0.0
        	if (t_1 <= Float64(-Inf))
        		tmp = Float64(Float64(1.0 + Float64(-0.5 * sqrt(Float64(Float64(x * x) * Float64(x * x))))) * t_2);
        	elseif (t_1 <= 0.9999999999999999)
        		tmp = Float64(cos(x) * t_2);
        	else
        		tmp = Float64(1.0 * t_0);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	t_0 = sinh(y) / y;
        	t_1 = cos(x) * t_0;
        	t_2 = ((y * y) * 0.16666666666666666) - -1.0;
        	tmp = 0.0;
        	if (t_1 <= -Inf)
        		tmp = (1.0 + (-0.5 * sqrt(((x * x) * (x * x))))) * t_2;
        	elseif (t_1 <= 0.9999999999999999)
        		tmp = cos(x) * t_2;
        	else
        		tmp = 1.0 * t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := Block[{t$95$0 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y * y), $MachinePrecision] * 1/6), $MachinePrecision] - -1), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(1 + N[(-1/2 * N[Sqrt[N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 9007199254740991/9007199254740992], N[(N[Cos[x], $MachinePrecision] * t$95$2), $MachinePrecision], N[(1 * t$95$0), $MachinePrecision]]]]]]
        
        \begin{array}{l}
        t_0 := \frac{\sinh y}{y}\\
        t_1 := \cos x \cdot t\_0\\
        t_2 := \left(y \cdot y\right) \cdot \frac{1}{6} - -1\\
        \mathbf{if}\;t\_1 \leq -\infty:\\
        \;\;\;\;\left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot t\_2\\
        
        \mathbf{elif}\;t\_1 \leq \frac{9007199254740991}{9007199254740992}:\\
        \;\;\;\;\cos x \cdot t\_2\\
        
        \mathbf{else}:\\
        \;\;\;\;1 \cdot t\_0\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0

          1. Initial program 100.0%

            \[\cos x \cdot \frac{\sinh y}{y} \]
          2. Taylor expanded in y around 0

            \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
          3. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
            2. lower-*.f64N/A

              \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
            3. lower-pow.f6477.5%

              \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
          4. Applied rewrites77.5%

            \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
          5. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
            2. +-commutativeN/A

              \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
            3. add-flipN/A

              \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
            4. metadata-evalN/A

              \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
            5. lower--.f6477.5%

              \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
            6. lift-*.f64N/A

              \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
            7. *-commutativeN/A

              \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
            8. lower-*.f6477.5%

              \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
            9. lift-pow.f64N/A

              \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
            10. unpow2N/A

              \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            11. lower-*.f6477.5%

              \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
          6. Applied rewrites77.5%

            \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]
          7. Taylor expanded in x around 0

            \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
          8. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \left(1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            2. lower-*.f64N/A

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            3. lower-pow.f6450.5%

              \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
          9. Applied rewrites50.5%

            \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
          10. Step-by-step derivation
            1. rem-square-sqrtN/A

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \left(\sqrt{{x}^{2}} \cdot \color{blue}{\sqrt{{x}^{2}}}\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            2. sqrt-unprodN/A

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            3. lower-sqrt.f64N/A

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            4. lower-*.f6450.8%

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            5. lift-pow.f64N/A

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            6. unpow2N/A

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            7. lower-*.f6450.8%

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            8. lift-pow.f64N/A

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            9. unpow2N/A

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            10. lower-*.f6450.8%

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
          11. Applied rewrites50.8%

            \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]

          if -inf.0 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < 0.99999999999999989

          1. Initial program 100.0%

            \[\cos x \cdot \frac{\sinh y}{y} \]
          2. Taylor expanded in y around 0

            \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
          3. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
            2. lower-*.f64N/A

              \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
            3. lower-pow.f6477.5%

              \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
          4. Applied rewrites77.5%

            \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
          5. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
            2. +-commutativeN/A

              \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
            3. add-flipN/A

              \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
            4. metadata-evalN/A

              \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
            5. lower--.f6477.5%

              \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
            6. lift-*.f64N/A

              \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
            7. *-commutativeN/A

              \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
            8. lower-*.f6477.5%

              \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
            9. lift-pow.f64N/A

              \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
            10. unpow2N/A

              \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            11. lower-*.f6477.5%

              \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
          6. Applied rewrites77.5%

            \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]

          if 0.99999999999999989 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y))

          1. Initial program 100.0%

            \[\cos x \cdot \frac{\sinh y}{y} \]
          2. Taylor expanded in x around 0

            \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
          3. Step-by-step derivation
            1. Applied rewrites64.4%

              \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
          4. Recombined 3 regimes into one program.
          5. Add Preprocessing

          Alternative 5: 98.5% accurate, 0.4× speedup?

          \[\begin{array}{l} t_0 := \frac{\sinh y}{y}\\ t_1 := \cos x \cdot t\_0\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right)\\ \mathbf{elif}\;t\_1 \leq \frac{9007199254740991}{9007199254740992}:\\ \;\;\;\;\frac{y \cdot \cos x}{y}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_0\\ \end{array} \]
          (FPCore (x y)
            :precision binary64
            (let* ((t_0 (/ (sinh y) y)) (t_1 (* (cos x) t_0)))
            (if (<= t_1 (- INFINITY))
              (*
               (+ 1 (* -1/2 (sqrt (* (* x x) (* x x)))))
               (- (* (* y y) 1/6) -1))
              (if (<= t_1 9007199254740991/9007199254740992)
                (/ (* y (cos x)) y)
                (* 1 t_0)))))
          double code(double x, double y) {
          	double t_0 = sinh(y) / y;
          	double t_1 = cos(x) * t_0;
          	double tmp;
          	if (t_1 <= -((double) INFINITY)) {
          		tmp = (1.0 + (-0.5 * sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0);
          	} else if (t_1 <= 0.9999999999999999) {
          		tmp = (y * cos(x)) / y;
          	} else {
          		tmp = 1.0 * t_0;
          	}
          	return tmp;
          }
          
          public static double code(double x, double y) {
          	double t_0 = Math.sinh(y) / y;
          	double t_1 = Math.cos(x) * t_0;
          	double tmp;
          	if (t_1 <= -Double.POSITIVE_INFINITY) {
          		tmp = (1.0 + (-0.5 * Math.sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0);
          	} else if (t_1 <= 0.9999999999999999) {
          		tmp = (y * Math.cos(x)) / y;
          	} else {
          		tmp = 1.0 * t_0;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	t_0 = math.sinh(y) / y
          	t_1 = math.cos(x) * t_0
          	tmp = 0
          	if t_1 <= -math.inf:
          		tmp = (1.0 + (-0.5 * math.sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0)
          	elif t_1 <= 0.9999999999999999:
          		tmp = (y * math.cos(x)) / y
          	else:
          		tmp = 1.0 * t_0
          	return tmp
          
          function code(x, y)
          	t_0 = Float64(sinh(y) / y)
          	t_1 = Float64(cos(x) * t_0)
          	tmp = 0.0
          	if (t_1 <= Float64(-Inf))
          		tmp = Float64(Float64(1.0 + Float64(-0.5 * sqrt(Float64(Float64(x * x) * Float64(x * x))))) * Float64(Float64(Float64(y * y) * 0.16666666666666666) - -1.0));
          	elseif (t_1 <= 0.9999999999999999)
          		tmp = Float64(Float64(y * cos(x)) / y);
          	else
          		tmp = Float64(1.0 * t_0);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	t_0 = sinh(y) / y;
          	t_1 = cos(x) * t_0;
          	tmp = 0.0;
          	if (t_1 <= -Inf)
          		tmp = (1.0 + (-0.5 * sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0);
          	elseif (t_1 <= 0.9999999999999999)
          		tmp = (y * cos(x)) / y;
          	else
          		tmp = 1.0 * t_0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := Block[{t$95$0 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(1 + N[(-1/2 * N[Sqrt[N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 1/6), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 9007199254740991/9007199254740992], N[(N[(y * N[Cos[x], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(1 * t$95$0), $MachinePrecision]]]]]
          
          \begin{array}{l}
          t_0 := \frac{\sinh y}{y}\\
          t_1 := \cos x \cdot t\_0\\
          \mathbf{if}\;t\_1 \leq -\infty:\\
          \;\;\;\;\left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right)\\
          
          \mathbf{elif}\;t\_1 \leq \frac{9007199254740991}{9007199254740992}:\\
          \;\;\;\;\frac{y \cdot \cos x}{y}\\
          
          \mathbf{else}:\\
          \;\;\;\;1 \cdot t\_0\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0

            1. Initial program 100.0%

              \[\cos x \cdot \frac{\sinh y}{y} \]
            2. Taylor expanded in y around 0

              \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
              2. lower-*.f64N/A

                \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
              3. lower-pow.f6477.5%

                \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
            4. Applied rewrites77.5%

              \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
            5. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
              2. +-commutativeN/A

                \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
              3. add-flipN/A

                \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
              4. metadata-evalN/A

                \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
              5. lower--.f6477.5%

                \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
              6. lift-*.f64N/A

                \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
              7. *-commutativeN/A

                \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
              8. lower-*.f6477.5%

                \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
              9. lift-pow.f64N/A

                \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
              10. unpow2N/A

                \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              11. lower-*.f6477.5%

                \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            6. Applied rewrites77.5%

              \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]
            7. Taylor expanded in x around 0

              \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            8. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \left(1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              2. lower-*.f64N/A

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              3. lower-pow.f6450.5%

                \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            9. Applied rewrites50.5%

              \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            10. Step-by-step derivation
              1. rem-square-sqrtN/A

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \left(\sqrt{{x}^{2}} \cdot \color{blue}{\sqrt{{x}^{2}}}\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              2. sqrt-unprodN/A

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              3. lower-sqrt.f64N/A

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              4. lower-*.f6450.8%

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              5. lift-pow.f64N/A

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              6. unpow2N/A

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              7. lower-*.f6450.8%

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              8. lift-pow.f64N/A

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              9. unpow2N/A

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              10. lower-*.f6450.8%

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
            11. Applied rewrites50.8%

              \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]

            if -inf.0 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < 0.99999999999999989

            1. Initial program 100.0%

              \[\cos x \cdot \frac{\sinh y}{y} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{\cos x \cdot \frac{\sinh y}{y}} \]
              2. lift-/.f64N/A

                \[\leadsto \cos x \cdot \color{blue}{\frac{\sinh y}{y}} \]
              3. associate-*r/N/A

                \[\leadsto \color{blue}{\frac{\cos x \cdot \sinh y}{y}} \]
              4. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\cos x \cdot \sinh y}{y}} \]
              5. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{\sinh y \cdot \cos x}}{y} \]
              6. lower-*.f6499.9%

                \[\leadsto \frac{\color{blue}{\sinh y \cdot \cos x}}{y} \]
            3. Applied rewrites99.9%

              \[\leadsto \color{blue}{\frac{\sinh y \cdot \cos x}{y}} \]
            4. Taylor expanded in y around 0

              \[\leadsto \frac{\color{blue}{y \cdot \cos x}}{y} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{y \cdot \color{blue}{\cos x}}{y} \]
              2. lower-cos.f6451.6%

                \[\leadsto \frac{y \cdot \cos x}{y} \]
            6. Applied rewrites51.6%

              \[\leadsto \frac{\color{blue}{y \cdot \cos x}}{y} \]

            if 0.99999999999999989 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y))

            1. Initial program 100.0%

              \[\cos x \cdot \frac{\sinh y}{y} \]
            2. Taylor expanded in x around 0

              \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
            3. Step-by-step derivation
              1. Applied rewrites64.4%

                \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
            4. Recombined 3 regimes into one program.
            5. Add Preprocessing

            Alternative 6: 76.4% accurate, 0.6× speedup?

            \[\begin{array}{l} t_0 := \frac{\sinh y}{y}\\ \mathbf{if}\;\cos x \cdot t\_0 \leq \frac{-3602879701896397}{72057594037927936}:\\ \;\;\;\;\left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_0\\ \end{array} \]
            (FPCore (x y)
              :precision binary64
              (let* ((t_0 (/ (sinh y) y)))
              (if (<= (* (cos x) t_0) -3602879701896397/72057594037927936)
                (*
                 (+ 1 (* -1/2 (sqrt (* (* x x) (* x x)))))
                 (- (* (* y y) 1/6) -1))
                (* 1 t_0))))
            double code(double x, double y) {
            	double t_0 = sinh(y) / y;
            	double tmp;
            	if ((cos(x) * t_0) <= -0.05) {
            		tmp = (1.0 + (-0.5 * sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0);
            	} else {
            		tmp = 1.0 * t_0;
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, y)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8) :: t_0
                real(8) :: tmp
                t_0 = sinh(y) / y
                if ((cos(x) * t_0) <= (-0.05d0)) then
                    tmp = (1.0d0 + ((-0.5d0) * sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666d0) - (-1.0d0))
                else
                    tmp = 1.0d0 * t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y) {
            	double t_0 = Math.sinh(y) / y;
            	double tmp;
            	if ((Math.cos(x) * t_0) <= -0.05) {
            		tmp = (1.0 + (-0.5 * Math.sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0);
            	} else {
            		tmp = 1.0 * t_0;
            	}
            	return tmp;
            }
            
            def code(x, y):
            	t_0 = math.sinh(y) / y
            	tmp = 0
            	if (math.cos(x) * t_0) <= -0.05:
            		tmp = (1.0 + (-0.5 * math.sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0)
            	else:
            		tmp = 1.0 * t_0
            	return tmp
            
            function code(x, y)
            	t_0 = Float64(sinh(y) / y)
            	tmp = 0.0
            	if (Float64(cos(x) * t_0) <= -0.05)
            		tmp = Float64(Float64(1.0 + Float64(-0.5 * sqrt(Float64(Float64(x * x) * Float64(x * x))))) * Float64(Float64(Float64(y * y) * 0.16666666666666666) - -1.0));
            	else
            		tmp = Float64(1.0 * t_0);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y)
            	t_0 = sinh(y) / y;
            	tmp = 0.0;
            	if ((cos(x) * t_0) <= -0.05)
            		tmp = (1.0 + (-0.5 * sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0);
            	else
            		tmp = 1.0 * t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_] := Block[{t$95$0 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision], -3602879701896397/72057594037927936], N[(N[(1 + N[(-1/2 * N[Sqrt[N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 1/6), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision], N[(1 * t$95$0), $MachinePrecision]]]
            
            \begin{array}{l}
            t_0 := \frac{\sinh y}{y}\\
            \mathbf{if}\;\cos x \cdot t\_0 \leq \frac{-3602879701896397}{72057594037927936}:\\
            \;\;\;\;\left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;1 \cdot t\_0\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003

              1. Initial program 100.0%

                \[\cos x \cdot \frac{\sinh y}{y} \]
              2. Taylor expanded in y around 0

                \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
              3. Step-by-step derivation
                1. lower-+.f64N/A

                  \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                3. lower-pow.f6477.5%

                  \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
              4. Applied rewrites77.5%

                \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
              5. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                2. +-commutativeN/A

                  \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
                3. add-flipN/A

                  \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
                4. metadata-evalN/A

                  \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
                5. lower--.f6477.5%

                  \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
                7. *-commutativeN/A

                  \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                8. lower-*.f6477.5%

                  \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                9. lift-pow.f64N/A

                  \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                10. unpow2N/A

                  \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                11. lower-*.f6477.5%

                  \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              6. Applied rewrites77.5%

                \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]
              7. Taylor expanded in x around 0

                \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              8. Step-by-step derivation
                1. lower-+.f64N/A

                  \[\leadsto \left(1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                3. lower-pow.f6450.5%

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              9. Applied rewrites50.5%

                \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              10. Step-by-step derivation
                1. rem-square-sqrtN/A

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \left(\sqrt{{x}^{2}} \cdot \color{blue}{\sqrt{{x}^{2}}}\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                2. sqrt-unprodN/A

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                4. lower-*.f6450.8%

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                5. lift-pow.f64N/A

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                6. unpow2N/A

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                7. lower-*.f6450.8%

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                8. lift-pow.f64N/A

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                9. unpow2N/A

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                10. lower-*.f6450.8%

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
              11. Applied rewrites50.8%

                \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]

              if -0.050000000000000003 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y))

              1. Initial program 100.0%

                \[\cos x \cdot \frac{\sinh y}{y} \]
              2. Taylor expanded in x around 0

                \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
              3. Step-by-step derivation
                1. Applied rewrites64.4%

                  \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 7: 70.5% accurate, 0.7× speedup?

              \[\begin{array}{l} t_0 := \left|y\right| \cdot \left|y\right|\\ t_1 := \left(t\_0 \cdot \frac{1}{36}\right) \cdot \left|y\right|\\ \mathbf{if}\;\cos x \cdot \frac{\sinh \left(\left|y\right|\right)}{\left|y\right|} \leq \frac{-3602879701896397}{72057594037927936}:\\ \;\;\;\;\left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(t\_0 \cdot \frac{1}{6} - -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(1 + \sqrt{\left|y\right|} \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\right)\\ \end{array} \]
              (FPCore (x y)
                :precision binary64
                (let* ((t_0 (* (fabs y) (fabs y))) (t_1 (* (* t_0 1/36) (fabs y))))
                (if (<=
                     (* (cos x) (/ (sinh (fabs y)) (fabs y)))
                     -3602879701896397/72057594037927936)
                  (* (+ 1 (* -1/2 (sqrt (* (* x x) (* x x))))) (- (* t_0 1/6) -1))
                  (* 1 (+ 1 (* (sqrt (fabs y)) (sqrt (sqrt (* t_1 t_1)))))))))
              double code(double x, double y) {
              	double t_0 = fabs(y) * fabs(y);
              	double t_1 = (t_0 * 0.027777777777777776) * fabs(y);
              	double tmp;
              	if ((cos(x) * (sinh(fabs(y)) / fabs(y))) <= -0.05) {
              		tmp = (1.0 + (-0.5 * sqrt(((x * x) * (x * x))))) * ((t_0 * 0.16666666666666666) - -1.0);
              	} else {
              		tmp = 1.0 * (1.0 + (sqrt(fabs(y)) * sqrt(sqrt((t_1 * t_1)))));
              	}
              	return tmp;
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(x, y)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8) :: t_0
                  real(8) :: t_1
                  real(8) :: tmp
                  t_0 = abs(y) * abs(y)
                  t_1 = (t_0 * 0.027777777777777776d0) * abs(y)
                  if ((cos(x) * (sinh(abs(y)) / abs(y))) <= (-0.05d0)) then
                      tmp = (1.0d0 + ((-0.5d0) * sqrt(((x * x) * (x * x))))) * ((t_0 * 0.16666666666666666d0) - (-1.0d0))
                  else
                      tmp = 1.0d0 * (1.0d0 + (sqrt(abs(y)) * sqrt(sqrt((t_1 * t_1)))))
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y) {
              	double t_0 = Math.abs(y) * Math.abs(y);
              	double t_1 = (t_0 * 0.027777777777777776) * Math.abs(y);
              	double tmp;
              	if ((Math.cos(x) * (Math.sinh(Math.abs(y)) / Math.abs(y))) <= -0.05) {
              		tmp = (1.0 + (-0.5 * Math.sqrt(((x * x) * (x * x))))) * ((t_0 * 0.16666666666666666) - -1.0);
              	} else {
              		tmp = 1.0 * (1.0 + (Math.sqrt(Math.abs(y)) * Math.sqrt(Math.sqrt((t_1 * t_1)))));
              	}
              	return tmp;
              }
              
              def code(x, y):
              	t_0 = math.fabs(y) * math.fabs(y)
              	t_1 = (t_0 * 0.027777777777777776) * math.fabs(y)
              	tmp = 0
              	if (math.cos(x) * (math.sinh(math.fabs(y)) / math.fabs(y))) <= -0.05:
              		tmp = (1.0 + (-0.5 * math.sqrt(((x * x) * (x * x))))) * ((t_0 * 0.16666666666666666) - -1.0)
              	else:
              		tmp = 1.0 * (1.0 + (math.sqrt(math.fabs(y)) * math.sqrt(math.sqrt((t_1 * t_1)))))
              	return tmp
              
              function code(x, y)
              	t_0 = Float64(abs(y) * abs(y))
              	t_1 = Float64(Float64(t_0 * 0.027777777777777776) * abs(y))
              	tmp = 0.0
              	if (Float64(cos(x) * Float64(sinh(abs(y)) / abs(y))) <= -0.05)
              		tmp = Float64(Float64(1.0 + Float64(-0.5 * sqrt(Float64(Float64(x * x) * Float64(x * x))))) * Float64(Float64(t_0 * 0.16666666666666666) - -1.0));
              	else
              		tmp = Float64(1.0 * Float64(1.0 + Float64(sqrt(abs(y)) * sqrt(sqrt(Float64(t_1 * t_1))))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y)
              	t_0 = abs(y) * abs(y);
              	t_1 = (t_0 * 0.027777777777777776) * abs(y);
              	tmp = 0.0;
              	if ((cos(x) * (sinh(abs(y)) / abs(y))) <= -0.05)
              		tmp = (1.0 + (-0.5 * sqrt(((x * x) * (x * x))))) * ((t_0 * 0.16666666666666666) - -1.0);
              	else
              		tmp = 1.0 * (1.0 + (sqrt(abs(y)) * sqrt(sqrt((t_1 * t_1)))));
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_] := Block[{t$95$0 = N[(N[Abs[y], $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * 1/36), $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[N[Abs[y], $MachinePrecision]], $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -3602879701896397/72057594037927936], N[(N[(1 + N[(-1/2 * N[Sqrt[N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * 1/6), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision], N[(1 * N[(1 + N[(N[Sqrt[N[Abs[y], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
              
              \begin{array}{l}
              t_0 := \left|y\right| \cdot \left|y\right|\\
              t_1 := \left(t\_0 \cdot \frac{1}{36}\right) \cdot \left|y\right|\\
              \mathbf{if}\;\cos x \cdot \frac{\sinh \left(\left|y\right|\right)}{\left|y\right|} \leq \frac{-3602879701896397}{72057594037927936}:\\
              \;\;\;\;\left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(t\_0 \cdot \frac{1}{6} - -1\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;1 \cdot \left(1 + \sqrt{\left|y\right|} \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\right)\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003

                1. Initial program 100.0%

                  \[\cos x \cdot \frac{\sinh y}{y} \]
                2. Taylor expanded in y around 0

                  \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                3. Step-by-step derivation
                  1. lower-+.f64N/A

                    \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                  2. lower-*.f64N/A

                    \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                  3. lower-pow.f6477.5%

                    \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                4. Applied rewrites77.5%

                  \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                5. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                  2. +-commutativeN/A

                    \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
                  3. add-flipN/A

                    \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
                  4. metadata-evalN/A

                    \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
                  5. lower--.f6477.5%

                    \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
                  6. lift-*.f64N/A

                    \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                  8. lower-*.f6477.5%

                    \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                  9. lift-pow.f64N/A

                    \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                  10. unpow2N/A

                    \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  11. lower-*.f6477.5%

                    \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                6. Applied rewrites77.5%

                  \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]
                7. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                8. Step-by-step derivation
                  1. lower-+.f64N/A

                    \[\leadsto \left(1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  2. lower-*.f64N/A

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  3. lower-pow.f6450.5%

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                9. Applied rewrites50.5%

                  \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                10. Step-by-step derivation
                  1. rem-square-sqrtN/A

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \left(\sqrt{{x}^{2}} \cdot \color{blue}{\sqrt{{x}^{2}}}\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  2. sqrt-unprodN/A

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  4. lower-*.f6450.8%

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  5. lift-pow.f64N/A

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  6. unpow2N/A

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  7. lower-*.f6450.8%

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  8. lift-pow.f64N/A

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  9. unpow2N/A

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  10. lower-*.f6450.8%

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                11. Applied rewrites50.8%

                  \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]

                if -0.050000000000000003 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y))

                1. Initial program 100.0%

                  \[\cos x \cdot \frac{\sinh y}{y} \]
                2. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
                3. Step-by-step derivation
                  1. Applied rewrites64.4%

                    \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
                  2. Taylor expanded in y around 0

                    \[\leadsto 1 \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                  3. Step-by-step derivation
                    1. lower-+.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                    2. lower-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                    3. lower-pow.f6447.9%

                      \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                  4. Applied rewrites47.9%

                    \[\leadsto 1 \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                  5. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                    2. metadata-evalN/A

                      \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot {\color{blue}{y}}^{2}\right) \]
                    3. lift-pow.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot {y}^{\color{blue}{2}}\right) \]
                    4. pow2N/A

                      \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
                    5. fabs-sqrN/A

                      \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot \left|y \cdot y\right|\right) \]
                    6. lift-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot \left|y \cdot y\right|\right) \]
                    7. fabs-mulN/A

                      \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6} \cdot \left(y \cdot y\right)\right|\right) \]
                    8. *-commutativeN/A

                      \[\leadsto 1 \cdot \left(1 + \left|\left(y \cdot y\right) \cdot \frac{1}{6}\right|\right) \]
                    9. lift-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \left|\left(y \cdot y\right) \cdot \frac{1}{6}\right|\right) \]
                    10. rem-sqrt-square-revN/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                    11. lift-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                    12. associate-*l*N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{\left(y \cdot y\right) \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)}\right) \]
                    13. lift-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{\left(y \cdot y\right) \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)}\right) \]
                    14. associate-*l*N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y \cdot \left(y \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)\right)}\right) \]
                    15. sqrt-prodN/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \color{blue}{\sqrt{y \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)}}\right) \]
                    16. lower-unsound-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \color{blue}{\sqrt{y \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)}}\right) \]
                    17. lower-unsound-sqrt.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\color{blue}{y \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)}}\right) \]
                    18. lower-unsound-sqrt.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{y \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)}\right) \]
                    19. lower-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{y \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)}\right) \]
                    20. lift-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{y \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)}\right) \]
                    21. *-commutativeN/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{y \cdot \left(\frac{1}{6} \cdot \left(\frac{1}{6} \cdot \left(y \cdot y\right)\right)\right)}\right) \]
                    22. associate-*r*N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{y \cdot \left(\left(\frac{1}{6} \cdot \frac{1}{6}\right) \cdot \left(y \cdot y\right)\right)}\right) \]
                    23. lower-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{y \cdot \left(\left(\frac{1}{6} \cdot \frac{1}{6}\right) \cdot \left(y \cdot y\right)\right)}\right) \]
                    24. metadata-eval27.3%

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)}\right) \]
                  6. Applied rewrites27.3%

                    \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \color{blue}{\sqrt{y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)}}\right) \]
                  7. Step-by-step derivation
                    1. rem-square-sqrtN/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)} \cdot \sqrt{y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)}}\right) \]
                    2. sqrt-unprodN/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right) \cdot \left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
                    3. lower-sqrt.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right) \cdot \left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
                    4. lower-*.f6430.0%

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right) \cdot \left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
                    5. lift-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right) \cdot \left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
                    6. *-commutativeN/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot y\right) \cdot \left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
                    7. lower-*.f6430.0%

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot y\right) \cdot \left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot y\right) \cdot \left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
                    9. *-commutativeN/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right) \cdot \left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
                    10. lower-*.f6430.0%

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right) \cdot \left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
                    11. lift-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right) \cdot \left(y \cdot \left(\frac{1}{36} \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
                    12. *-commutativeN/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right) \cdot \left(\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot y\right)}}\right) \]
                    13. lower-*.f6430.0%

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right) \cdot \left(\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot y\right)}}\right) \]
                    14. lift-*.f64N/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right) \cdot \left(\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot y\right)}}\right) \]
                    15. *-commutativeN/A

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right) \cdot \left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right)}}\right) \]
                    16. lower-*.f6430.0%

                      \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right) \cdot \left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right)}}\right) \]
                  8. Applied rewrites30.0%

                    \[\leadsto 1 \cdot \left(1 + \sqrt{y} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right) \cdot \left(\left(\left(y \cdot y\right) \cdot \frac{1}{36}\right) \cdot y\right)}}\right) \]
                4. Recombined 2 regimes into one program.
                5. Add Preprocessing

                Alternative 8: 67.9% accurate, 0.8× speedup?

                \[\begin{array}{l} \mathbf{if}\;\cos x \cdot \frac{\sinh y}{y} \leq \frac{-3602879701896397}{72057594037927936}:\\ \;\;\;\;\left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(1 + \sqrt{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right)\\ \end{array} \]
                (FPCore (x y)
                  :precision binary64
                  (if (<=
                     (* (cos x) (/ (sinh y) y))
                     -3602879701896397/72057594037927936)
                  (* (+ 1 (* -1/2 (sqrt (* (* x x) (* x x))))) (- (* (* y y) 1/6) -1))
                  (* 1 (+ 1 (sqrt (* (* 1/36 (* y y)) (* y y)))))))
                double code(double x, double y) {
                	double tmp;
                	if ((cos(x) * (sinh(y) / y)) <= -0.05) {
                		tmp = (1.0 + (-0.5 * sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0);
                	} else {
                		tmp = 1.0 * (1.0 + sqrt(((0.027777777777777776 * (y * y)) * (y * y))));
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, y)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8) :: tmp
                    if ((cos(x) * (sinh(y) / y)) <= (-0.05d0)) then
                        tmp = (1.0d0 + ((-0.5d0) * sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666d0) - (-1.0d0))
                    else
                        tmp = 1.0d0 * (1.0d0 + sqrt(((0.027777777777777776d0 * (y * y)) * (y * y))))
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y) {
                	double tmp;
                	if ((Math.cos(x) * (Math.sinh(y) / y)) <= -0.05) {
                		tmp = (1.0 + (-0.5 * Math.sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0);
                	} else {
                		tmp = 1.0 * (1.0 + Math.sqrt(((0.027777777777777776 * (y * y)) * (y * y))));
                	}
                	return tmp;
                }
                
                def code(x, y):
                	tmp = 0
                	if (math.cos(x) * (math.sinh(y) / y)) <= -0.05:
                		tmp = (1.0 + (-0.5 * math.sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0)
                	else:
                		tmp = 1.0 * (1.0 + math.sqrt(((0.027777777777777776 * (y * y)) * (y * y))))
                	return tmp
                
                function code(x, y)
                	tmp = 0.0
                	if (Float64(cos(x) * Float64(sinh(y) / y)) <= -0.05)
                		tmp = Float64(Float64(1.0 + Float64(-0.5 * sqrt(Float64(Float64(x * x) * Float64(x * x))))) * Float64(Float64(Float64(y * y) * 0.16666666666666666) - -1.0));
                	else
                		tmp = Float64(1.0 * Float64(1.0 + sqrt(Float64(Float64(0.027777777777777776 * Float64(y * y)) * Float64(y * y)))));
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y)
                	tmp = 0.0;
                	if ((cos(x) * (sinh(y) / y)) <= -0.05)
                		tmp = (1.0 + (-0.5 * sqrt(((x * x) * (x * x))))) * (((y * y) * 0.16666666666666666) - -1.0);
                	else
                		tmp = 1.0 * (1.0 + sqrt(((0.027777777777777776 * (y * y)) * (y * y))));
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_] := If[LessEqual[N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -3602879701896397/72057594037927936], N[(N[(1 + N[(-1/2 * N[Sqrt[N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * 1/6), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision], N[(1 * N[(1 + N[Sqrt[N[(N[(1/36 * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                \mathbf{if}\;\cos x \cdot \frac{\sinh y}{y} \leq \frac{-3602879701896397}{72057594037927936}:\\
                \;\;\;\;\left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;1 \cdot \left(1 + \sqrt{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right)\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003

                  1. Initial program 100.0%

                    \[\cos x \cdot \frac{\sinh y}{y} \]
                  2. Taylor expanded in y around 0

                    \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                  3. Step-by-step derivation
                    1. lower-+.f64N/A

                      \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                    2. lower-*.f64N/A

                      \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                    3. lower-pow.f6477.5%

                      \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                  4. Applied rewrites77.5%

                    \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                  5. Step-by-step derivation
                    1. lift-+.f64N/A

                      \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                    2. +-commutativeN/A

                      \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
                    3. add-flipN/A

                      \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
                    4. metadata-evalN/A

                      \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
                    5. lower--.f6477.5%

                      \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
                    6. lift-*.f64N/A

                      \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                    8. lower-*.f6477.5%

                      \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                    9. lift-pow.f64N/A

                      \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                    10. unpow2N/A

                      \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    11. lower-*.f6477.5%

                      \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  6. Applied rewrites77.5%

                    \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]
                  7. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  8. Step-by-step derivation
                    1. lower-+.f64N/A

                      \[\leadsto \left(1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    2. lower-*.f64N/A

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    3. lower-pow.f6450.5%

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  9. Applied rewrites50.5%

                    \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  10. Step-by-step derivation
                    1. rem-square-sqrtN/A

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \left(\sqrt{{x}^{2}} \cdot \color{blue}{\sqrt{{x}^{2}}}\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    2. sqrt-unprodN/A

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    3. lower-sqrt.f64N/A

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    4. lower-*.f6450.8%

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    5. lift-pow.f64N/A

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    6. unpow2N/A

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    7. lower-*.f6450.8%

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    8. lift-pow.f64N/A

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    9. unpow2N/A

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    10. lower-*.f6450.8%

                      \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                  11. Applied rewrites50.8%

                    \[\leadsto \left(1 + \frac{-1}{2} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]

                  if -0.050000000000000003 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y))

                  1. Initial program 100.0%

                    \[\cos x \cdot \frac{\sinh y}{y} \]
                  2. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
                  3. Step-by-step derivation
                    1. Applied rewrites64.4%

                      \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
                    2. Taylor expanded in y around 0

                      \[\leadsto 1 \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                    3. Step-by-step derivation
                      1. lower-+.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                      3. lower-pow.f6447.9%

                        \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                    4. Applied rewrites47.9%

                      \[\leadsto 1 \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                    5. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                      2. metadata-evalN/A

                        \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot {\color{blue}{y}}^{2}\right) \]
                      3. lift-pow.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot {y}^{\color{blue}{2}}\right) \]
                      4. pow2N/A

                        \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
                      5. fabs-sqrN/A

                        \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot \left|y \cdot y\right|\right) \]
                      6. lift-*.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot \left|y \cdot y\right|\right) \]
                      7. fabs-mulN/A

                        \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6} \cdot \left(y \cdot y\right)\right|\right) \]
                      8. *-commutativeN/A

                        \[\leadsto 1 \cdot \left(1 + \left|\left(y \cdot y\right) \cdot \frac{1}{6}\right|\right) \]
                      9. lift-*.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \left|\left(y \cdot y\right) \cdot \frac{1}{6}\right|\right) \]
                      10. rem-sqrt-square-revN/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                      11. lift-*.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                      12. lower-sqrt.f6456.0%

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                      13. lift-*.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                      14. lift-*.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                      15. associate-*l*N/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(y \cdot y\right) \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)}\right) \]
                      16. *-commutativeN/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                      17. lower-*.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                      18. lift-*.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                      19. *-commutativeN/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{6} \cdot \left(\frac{1}{6} \cdot \left(y \cdot y\right)\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                      20. associate-*r*N/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(\frac{1}{6} \cdot \frac{1}{6}\right) \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                      21. lower-*.f64N/A

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(\frac{1}{6} \cdot \frac{1}{6}\right) \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                      22. metadata-eval56.0%

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                    6. Applied rewrites56.0%

                      \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                  4. Recombined 2 regimes into one program.
                  5. Add Preprocessing

                  Alternative 9: 67.6% accurate, 0.8× speedup?

                  \[\begin{array}{l} \mathbf{if}\;\cos x \cdot \frac{\sinh y}{y} \leq \frac{-3602879701896397}{72057594037927936}:\\ \;\;\;\;\left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{2} - -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(1 + \sqrt{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right)\\ \end{array} \]
                  (FPCore (x y)
                    :precision binary64
                    (if (<=
                       (* (cos x) (/ (sinh y) y))
                       -3602879701896397/72057594037927936)
                    (* (- (* 1/6 (* y y)) -1) (- (* (* x x) -1/2) -1))
                    (* 1 (+ 1 (sqrt (* (* 1/36 (* y y)) (* y y)))))))
                  double code(double x, double y) {
                  	double tmp;
                  	if ((cos(x) * (sinh(y) / y)) <= -0.05) {
                  		tmp = ((0.16666666666666666 * (y * y)) - -1.0) * (((x * x) * -0.5) - -1.0);
                  	} else {
                  		tmp = 1.0 * (1.0 + sqrt(((0.027777777777777776 * (y * y)) * (y * y))));
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8) :: tmp
                      if ((cos(x) * (sinh(y) / y)) <= (-0.05d0)) then
                          tmp = ((0.16666666666666666d0 * (y * y)) - (-1.0d0)) * (((x * x) * (-0.5d0)) - (-1.0d0))
                      else
                          tmp = 1.0d0 * (1.0d0 + sqrt(((0.027777777777777776d0 * (y * y)) * (y * y))))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y) {
                  	double tmp;
                  	if ((Math.cos(x) * (Math.sinh(y) / y)) <= -0.05) {
                  		tmp = ((0.16666666666666666 * (y * y)) - -1.0) * (((x * x) * -0.5) - -1.0);
                  	} else {
                  		tmp = 1.0 * (1.0 + Math.sqrt(((0.027777777777777776 * (y * y)) * (y * y))));
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y):
                  	tmp = 0
                  	if (math.cos(x) * (math.sinh(y) / y)) <= -0.05:
                  		tmp = ((0.16666666666666666 * (y * y)) - -1.0) * (((x * x) * -0.5) - -1.0)
                  	else:
                  		tmp = 1.0 * (1.0 + math.sqrt(((0.027777777777777776 * (y * y)) * (y * y))))
                  	return tmp
                  
                  function code(x, y)
                  	tmp = 0.0
                  	if (Float64(cos(x) * Float64(sinh(y) / y)) <= -0.05)
                  		tmp = Float64(Float64(Float64(0.16666666666666666 * Float64(y * y)) - -1.0) * Float64(Float64(Float64(x * x) * -0.5) - -1.0));
                  	else
                  		tmp = Float64(1.0 * Float64(1.0 + sqrt(Float64(Float64(0.027777777777777776 * Float64(y * y)) * Float64(y * y)))));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y)
                  	tmp = 0.0;
                  	if ((cos(x) * (sinh(y) / y)) <= -0.05)
                  		tmp = ((0.16666666666666666 * (y * y)) - -1.0) * (((x * x) * -0.5) - -1.0);
                  	else
                  		tmp = 1.0 * (1.0 + sqrt(((0.027777777777777776 * (y * y)) * (y * y))));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_] := If[LessEqual[N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], -3602879701896397/72057594037927936], N[(N[(N[(1/6 * N[(y * y), $MachinePrecision]), $MachinePrecision] - -1), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * -1/2), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision], N[(1 * N[(1 + N[Sqrt[N[(N[(1/36 * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  \mathbf{if}\;\cos x \cdot \frac{\sinh y}{y} \leq \frac{-3602879701896397}{72057594037927936}:\\
                  \;\;\;\;\left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{2} - -1\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;1 \cdot \left(1 + \sqrt{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right)\\
                  
                  
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y)) < -0.050000000000000003

                    1. Initial program 100.0%

                      \[\cos x \cdot \frac{\sinh y}{y} \]
                    2. Taylor expanded in y around 0

                      \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                    3. Step-by-step derivation
                      1. lower-+.f64N/A

                        \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                      3. lower-pow.f6477.5%

                        \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                    4. Applied rewrites77.5%

                      \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                    5. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                      2. +-commutativeN/A

                        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
                      3. add-flipN/A

                        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
                      4. metadata-evalN/A

                        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
                      5. lower--.f6477.5%

                        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
                      6. lift-*.f64N/A

                        \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
                      7. *-commutativeN/A

                        \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                      8. lower-*.f6477.5%

                        \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                      9. lift-pow.f64N/A

                        \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                      10. unpow2N/A

                        \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                      11. lower-*.f6477.5%

                        \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    6. Applied rewrites77.5%

                      \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]
                    7. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    8. Step-by-step derivation
                      1. lower-+.f64N/A

                        \[\leadsto \left(1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \left(1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                      3. lower-pow.f6450.5%

                        \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    9. Applied rewrites50.5%

                      \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                    10. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right)} \]
                      2. *-commutativeN/A

                        \[\leadsto \color{blue}{\left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \cdot \left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \]
                      3. lower-*.f6450.5%

                        \[\leadsto \color{blue}{\left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \cdot \left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \]
                      4. lift-*.f64N/A

                        \[\leadsto \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \cdot \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \]
                      5. *-commutativeN/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \]
                      6. lower-*.f6450.5%

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \]
                      7. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \mathsf{Rewrite=>}\left(lift-+.f64, \left(1 + \frac{-1}{2} \cdot {x}^{2}\right)\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \mathsf{Rewrite=>}\left(+-commutative, \left(\frac{-1}{2} \cdot {x}^{2} + 1\right)\right) \]
                      9. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \mathsf{Rewrite=>}\left(add-flip, \left(\frac{-1}{2} \cdot {x}^{2} - \left(\mathsf{neg}\left(1\right)\right)\right)\right) \]
                      10. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\frac{-1}{2} \cdot {x}^{2} - \mathsf{Rewrite=>}\left(metadata-eval, -1\right)\right) \]
                      11. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \mathsf{Rewrite=>}\left(lower--.f64, \left(\frac{-1}{2} \cdot {x}^{2} - -1\right)\right) \]
                      12. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(lift-*.f64, \left(\frac{-1}{2} \cdot {x}^{2}\right)\right) - -1\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(*-commutative, \left({x}^{2} \cdot \frac{-1}{2}\right)\right) - -1\right) \]
                      14. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(lower-*.f64, \left({x}^{2} \cdot \frac{-1}{2}\right)\right) - -1\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(lift-pow.f64, \left({x}^{2}\right)\right) \cdot \frac{-1}{2} - -1\right) \]
                      16. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(unpow2, \left(x \cdot x\right)\right) \cdot \frac{-1}{2} - -1\right) \]
                      17. lower-*.f64N/A

                        \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(lower-*.f64, \left(x \cdot x\right)\right) \cdot \frac{-1}{2} - -1\right) \]
                    11. Applied rewrites50.5%

                      \[\leadsto \color{blue}{\left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{2} - -1\right)} \]

                    if -0.050000000000000003 < (*.f64 (cos.f64 x) (/.f64 (sinh.f64 y) y))

                    1. Initial program 100.0%

                      \[\cos x \cdot \frac{\sinh y}{y} \]
                    2. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
                    3. Step-by-step derivation
                      1. Applied rewrites64.4%

                        \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
                      2. Taylor expanded in y around 0

                        \[\leadsto 1 \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                      3. Step-by-step derivation
                        1. lower-+.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                        2. lower-*.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                        3. lower-pow.f6447.9%

                          \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                      4. Applied rewrites47.9%

                        \[\leadsto 1 \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                      5. Step-by-step derivation
                        1. lift-*.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                        2. metadata-evalN/A

                          \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot {\color{blue}{y}}^{2}\right) \]
                        3. lift-pow.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot {y}^{\color{blue}{2}}\right) \]
                        4. pow2N/A

                          \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
                        5. fabs-sqrN/A

                          \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot \left|y \cdot y\right|\right) \]
                        6. lift-*.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6}\right| \cdot \left|y \cdot y\right|\right) \]
                        7. fabs-mulN/A

                          \[\leadsto 1 \cdot \left(1 + \left|\frac{1}{6} \cdot \left(y \cdot y\right)\right|\right) \]
                        8. *-commutativeN/A

                          \[\leadsto 1 \cdot \left(1 + \left|\left(y \cdot y\right) \cdot \frac{1}{6}\right|\right) \]
                        9. lift-*.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \left|\left(y \cdot y\right) \cdot \frac{1}{6}\right|\right) \]
                        10. rem-sqrt-square-revN/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                        11. lift-*.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                        12. lower-sqrt.f6456.0%

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                        13. lift-*.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                        14. lift-*.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)}\right) \]
                        15. associate-*l*N/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(y \cdot y\right) \cdot \left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)}\right) \]
                        16. *-commutativeN/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                        17. lower-*.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                        18. lift-*.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{6} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                        19. *-commutativeN/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{6} \cdot \left(\frac{1}{6} \cdot \left(y \cdot y\right)\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                        20. associate-*r*N/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(\frac{1}{6} \cdot \frac{1}{6}\right) \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                        21. lower-*.f64N/A

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\left(\frac{1}{6} \cdot \frac{1}{6}\right) \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                        22. metadata-eval56.0%

                          \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                      6. Applied rewrites56.0%

                        \[\leadsto 1 \cdot \left(1 + \sqrt{\left(\frac{1}{36} \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 10: 59.1% accurate, 1.6× speedup?

                    \[\begin{array}{l} \mathbf{if}\;\cos x \leq \frac{-3602879701896397}{72057594037927936}:\\ \;\;\;\;\left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{2} - -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot y\right)\\ \end{array} \]
                    (FPCore (x y)
                      :precision binary64
                      (if (<= (cos x) -3602879701896397/72057594037927936)
                      (* (- (* 1/6 (* y y)) -1) (- (* (* x x) -1/2) -1))
                      (* 1 (+ 1 (* (* 1/6 y) y)))))
                    double code(double x, double y) {
                    	double tmp;
                    	if (cos(x) <= -0.05) {
                    		tmp = ((0.16666666666666666 * (y * y)) - -1.0) * (((x * x) * -0.5) - -1.0);
                    	} else {
                    		tmp = 1.0 * (1.0 + ((0.16666666666666666 * y) * y));
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8) :: tmp
                        if (cos(x) <= (-0.05d0)) then
                            tmp = ((0.16666666666666666d0 * (y * y)) - (-1.0d0)) * (((x * x) * (-0.5d0)) - (-1.0d0))
                        else
                            tmp = 1.0d0 * (1.0d0 + ((0.16666666666666666d0 * y) * y))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y) {
                    	double tmp;
                    	if (Math.cos(x) <= -0.05) {
                    		tmp = ((0.16666666666666666 * (y * y)) - -1.0) * (((x * x) * -0.5) - -1.0);
                    	} else {
                    		tmp = 1.0 * (1.0 + ((0.16666666666666666 * y) * y));
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y):
                    	tmp = 0
                    	if math.cos(x) <= -0.05:
                    		tmp = ((0.16666666666666666 * (y * y)) - -1.0) * (((x * x) * -0.5) - -1.0)
                    	else:
                    		tmp = 1.0 * (1.0 + ((0.16666666666666666 * y) * y))
                    	return tmp
                    
                    function code(x, y)
                    	tmp = 0.0
                    	if (cos(x) <= -0.05)
                    		tmp = Float64(Float64(Float64(0.16666666666666666 * Float64(y * y)) - -1.0) * Float64(Float64(Float64(x * x) * -0.5) - -1.0));
                    	else
                    		tmp = Float64(1.0 * Float64(1.0 + Float64(Float64(0.16666666666666666 * y) * y)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y)
                    	tmp = 0.0;
                    	if (cos(x) <= -0.05)
                    		tmp = ((0.16666666666666666 * (y * y)) - -1.0) * (((x * x) * -0.5) - -1.0);
                    	else
                    		tmp = 1.0 * (1.0 + ((0.16666666666666666 * y) * y));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_] := If[LessEqual[N[Cos[x], $MachinePrecision], -3602879701896397/72057594037927936], N[(N[(N[(1/6 * N[(y * y), $MachinePrecision]), $MachinePrecision] - -1), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * -1/2), $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision], N[(1 * N[(1 + N[(N[(1/6 * y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    \mathbf{if}\;\cos x \leq \frac{-3602879701896397}{72057594037927936}:\\
                    \;\;\;\;\left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{2} - -1\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;1 \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot y\right)\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (cos.f64 x) < -0.050000000000000003

                      1. Initial program 100.0%

                        \[\cos x \cdot \frac{\sinh y}{y} \]
                      2. Taylor expanded in y around 0

                        \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                      3. Step-by-step derivation
                        1. lower-+.f64N/A

                          \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                        2. lower-*.f64N/A

                          \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                        3. lower-pow.f6477.5%

                          \[\leadsto \cos x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                      4. Applied rewrites77.5%

                        \[\leadsto \cos x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                      5. Step-by-step derivation
                        1. lift-+.f64N/A

                          \[\leadsto \cos x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
                        3. add-flipN/A

                          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
                        4. metadata-evalN/A

                          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
                        5. lower--.f6477.5%

                          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{-1}\right) \]
                        6. lift-*.f64N/A

                          \[\leadsto \cos x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
                        7. *-commutativeN/A

                          \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                        8. lower-*.f6477.5%

                          \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                        9. lift-pow.f64N/A

                          \[\leadsto \cos x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
                        10. unpow2N/A

                          \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                        11. lower-*.f6477.5%

                          \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                      6. Applied rewrites77.5%

                        \[\leadsto \cos x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - \color{blue}{-1}\right) \]
                      7. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                      8. Step-by-step derivation
                        1. lower-+.f64N/A

                          \[\leadsto \left(1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                        2. lower-*.f64N/A

                          \[\leadsto \left(1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                        3. lower-pow.f6450.5%

                          \[\leadsto \left(1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                      9. Applied rewrites50.5%

                        \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
                      10. Step-by-step derivation
                        1. lift-*.f64N/A

                          \[\leadsto \color{blue}{\left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right)} \]
                        2. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \cdot \left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \]
                        3. lower-*.f6450.5%

                          \[\leadsto \color{blue}{\left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \cdot \left(1 + \frac{-1}{2} \cdot {x}^{2}\right)} \]
                        4. lift-*.f64N/A

                          \[\leadsto \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \cdot \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \]
                        5. *-commutativeN/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \]
                        6. lower-*.f6450.5%

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(1 + \frac{-1}{2} \cdot {x}^{2}\right) \]
                        7. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \mathsf{Rewrite=>}\left(lift-+.f64, \left(1 + \frac{-1}{2} \cdot {x}^{2}\right)\right) \]
                        8. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \mathsf{Rewrite=>}\left(+-commutative, \left(\frac{-1}{2} \cdot {x}^{2} + 1\right)\right) \]
                        9. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \mathsf{Rewrite=>}\left(add-flip, \left(\frac{-1}{2} \cdot {x}^{2} - \left(\mathsf{neg}\left(1\right)\right)\right)\right) \]
                        10. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\frac{-1}{2} \cdot {x}^{2} - \mathsf{Rewrite=>}\left(metadata-eval, -1\right)\right) \]
                        11. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \mathsf{Rewrite=>}\left(lower--.f64, \left(\frac{-1}{2} \cdot {x}^{2} - -1\right)\right) \]
                        12. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(lift-*.f64, \left(\frac{-1}{2} \cdot {x}^{2}\right)\right) - -1\right) \]
                        13. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(*-commutative, \left({x}^{2} \cdot \frac{-1}{2}\right)\right) - -1\right) \]
                        14. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(lower-*.f64, \left({x}^{2} \cdot \frac{-1}{2}\right)\right) - -1\right) \]
                        15. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(lift-pow.f64, \left({x}^{2}\right)\right) \cdot \frac{-1}{2} - -1\right) \]
                        16. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(unpow2, \left(x \cdot x\right)\right) \cdot \frac{-1}{2} - -1\right) \]
                        17. lower-*.f64N/A

                          \[\leadsto \left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\mathsf{Rewrite=>}\left(lower-*.f64, \left(x \cdot x\right)\right) \cdot \frac{-1}{2} - -1\right) \]
                      11. Applied rewrites50.5%

                        \[\leadsto \color{blue}{\left(\frac{1}{6} \cdot \left(y \cdot y\right) - -1\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{2} - -1\right)} \]

                      if -0.050000000000000003 < (cos.f64 x)

                      1. Initial program 100.0%

                        \[\cos x \cdot \frac{\sinh y}{y} \]
                      2. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
                      3. Step-by-step derivation
                        1. Applied rewrites64.4%

                          \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
                        2. Taylor expanded in y around 0

                          \[\leadsto 1 \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                        3. Step-by-step derivation
                          1. lower-+.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                          2. lower-*.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                          3. lower-pow.f6447.9%

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                        4. Applied rewrites47.9%

                          \[\leadsto 1 \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                        5. Step-by-step derivation
                          1. lift-*.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                          2. lift-pow.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                          3. pow2N/A

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
                          4. lift-*.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
                          5. *-commutativeN/A

                            \[\leadsto 1 \cdot \left(1 + \left(y \cdot y\right) \cdot \color{blue}{\frac{1}{6}}\right) \]
                          6. lift-*.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \left(y \cdot y\right) \cdot \frac{1}{6}\right) \]
                          7. associate-*l*N/A

                            \[\leadsto 1 \cdot \left(1 + y \cdot \color{blue}{\left(y \cdot \frac{1}{6}\right)}\right) \]
                          8. *-commutativeN/A

                            \[\leadsto 1 \cdot \left(1 + \left(y \cdot \frac{1}{6}\right) \cdot \color{blue}{y}\right) \]
                          9. lower-*.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \left(y \cdot \frac{1}{6}\right) \cdot \color{blue}{y}\right) \]
                          10. *-commutativeN/A

                            \[\leadsto 1 \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot y\right) \]
                          11. lower-*.f6447.8%

                            \[\leadsto 1 \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot y\right) \]
                        6. Applied rewrites47.8%

                          \[\leadsto 1 \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot \color{blue}{y}\right) \]
                      4. Recombined 2 regimes into one program.
                      5. Add Preprocessing

                      Alternative 11: 47.8% accurate, 11.4× speedup?

                      \[1 \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot y\right) \]
                      (FPCore (x y)
                        :precision binary64
                        (* 1 (+ 1 (* (* 1/6 y) y))))
                      double code(double x, double y) {
                      	return 1.0 * (1.0 + ((0.16666666666666666 * y) * y));
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y)
                      use fmin_fmax_functions
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          code = 1.0d0 * (1.0d0 + ((0.16666666666666666d0 * y) * y))
                      end function
                      
                      public static double code(double x, double y) {
                      	return 1.0 * (1.0 + ((0.16666666666666666 * y) * y));
                      }
                      
                      def code(x, y):
                      	return 1.0 * (1.0 + ((0.16666666666666666 * y) * y))
                      
                      function code(x, y)
                      	return Float64(1.0 * Float64(1.0 + Float64(Float64(0.16666666666666666 * y) * y)))
                      end
                      
                      function tmp = code(x, y)
                      	tmp = 1.0 * (1.0 + ((0.16666666666666666 * y) * y));
                      end
                      
                      code[x_, y_] := N[(1 * N[(1 + N[(N[(1/6 * y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      1 \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot y\right)
                      
                      Derivation
                      1. Initial program 100.0%

                        \[\cos x \cdot \frac{\sinh y}{y} \]
                      2. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
                      3. Step-by-step derivation
                        1. Applied rewrites64.4%

                          \[\leadsto \color{blue}{1} \cdot \frac{\sinh y}{y} \]
                        2. Taylor expanded in y around 0

                          \[\leadsto 1 \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                        3. Step-by-step derivation
                          1. lower-+.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
                          2. lower-*.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                          3. lower-pow.f6447.9%

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                        4. Applied rewrites47.9%

                          \[\leadsto 1 \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
                        5. Step-by-step derivation
                          1. lift-*.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
                          2. lift-pow.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
                          3. pow2N/A

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
                          4. lift-*.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \frac{1}{6} \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
                          5. *-commutativeN/A

                            \[\leadsto 1 \cdot \left(1 + \left(y \cdot y\right) \cdot \color{blue}{\frac{1}{6}}\right) \]
                          6. lift-*.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \left(y \cdot y\right) \cdot \frac{1}{6}\right) \]
                          7. associate-*l*N/A

                            \[\leadsto 1 \cdot \left(1 + y \cdot \color{blue}{\left(y \cdot \frac{1}{6}\right)}\right) \]
                          8. *-commutativeN/A

                            \[\leadsto 1 \cdot \left(1 + \left(y \cdot \frac{1}{6}\right) \cdot \color{blue}{y}\right) \]
                          9. lower-*.f64N/A

                            \[\leadsto 1 \cdot \left(1 + \left(y \cdot \frac{1}{6}\right) \cdot \color{blue}{y}\right) \]
                          10. *-commutativeN/A

                            \[\leadsto 1 \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot y\right) \]
                          11. lower-*.f6447.8%

                            \[\leadsto 1 \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot y\right) \]
                        6. Applied rewrites47.8%

                          \[\leadsto 1 \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot \color{blue}{y}\right) \]
                        7. Add Preprocessing

                        Alternative 12: 28.9% accurate, 18.1× speedup?

                        \[\frac{y}{y} \]
                        (FPCore (x y)
                          :precision binary64
                          (/ y y))
                        double code(double x, double y) {
                        	return y / y;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            code = y / y
                        end function
                        
                        public static double code(double x, double y) {
                        	return y / y;
                        }
                        
                        def code(x, y):
                        	return y / y
                        
                        function code(x, y)
                        	return Float64(y / y)
                        end
                        
                        function tmp = code(x, y)
                        	tmp = y / y;
                        end
                        
                        code[x_, y_] := N[(y / y), $MachinePrecision]
                        
                        \frac{y}{y}
                        
                        Derivation
                        1. Initial program 100.0%

                          \[\cos x \cdot \frac{\sinh y}{y} \]
                        2. Step-by-step derivation
                          1. lift-*.f64N/A

                            \[\leadsto \color{blue}{\cos x \cdot \frac{\sinh y}{y}} \]
                          2. lift-/.f64N/A

                            \[\leadsto \cos x \cdot \color{blue}{\frac{\sinh y}{y}} \]
                          3. associate-*r/N/A

                            \[\leadsto \color{blue}{\frac{\cos x \cdot \sinh y}{y}} \]
                          4. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{\cos x \cdot \sinh y}{y}} \]
                          5. *-commutativeN/A

                            \[\leadsto \frac{\color{blue}{\sinh y \cdot \cos x}}{y} \]
                          6. lower-*.f6499.9%

                            \[\leadsto \frac{\color{blue}{\sinh y \cdot \cos x}}{y} \]
                        3. Applied rewrites99.9%

                          \[\leadsto \color{blue}{\frac{\sinh y \cdot \cos x}{y}} \]
                        4. Taylor expanded in y around 0

                          \[\leadsto \frac{\color{blue}{y \cdot \cos x}}{y} \]
                        5. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto \frac{y \cdot \color{blue}{\cos x}}{y} \]
                          2. lower-cos.f6451.6%

                            \[\leadsto \frac{y \cdot \cos x}{y} \]
                        6. Applied rewrites51.6%

                          \[\leadsto \frac{\color{blue}{y \cdot \cos x}}{y} \]
                        7. Taylor expanded in x around 0

                          \[\leadsto \frac{y}{y} \]
                        8. Step-by-step derivation
                          1. Applied rewrites28.9%

                            \[\leadsto \frac{y}{y} \]
                          2. Add Preprocessing

                          Reproduce

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