Linear.Quaternion:$cexp from linear-1.19.1.3

Percentage Accurate: 99.8% → 99.8%
Time: 2.4s
Alternatives: 5
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x \cdot \frac{\sin y}{y} \end{array} \]
(FPCore (x y) :precision binary64 (* x (/ (sin y) y)))
double code(double x, double y) {
	return x * (sin(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 = x * (sin(y) / y)
end function
public static double code(double x, double y) {
	return x * (Math.sin(y) / y);
}
def code(x, y):
	return x * (math.sin(y) / y)
function code(x, y)
	return Float64(x * Float64(sin(y) / y))
end
function tmp = code(x, y)
	tmp = x * (sin(y) / y);
end
code[x_, y_] := N[(x * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \frac{\sin y}{y}
\end{array}

Sampling outcomes in binary64 precision:

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 5 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: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \frac{\sin y}{y} \end{array} \]
(FPCore (x y) :precision binary64 (* x (/ (sin y) y)))
double code(double x, double y) {
	return x * (sin(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 = x * (sin(y) / y)
end function
public static double code(double x, double y) {
	return x * (Math.sin(y) / y);
}
def code(x, y):
	return x * (math.sin(y) / y)
function code(x, y)
	return Float64(x * Float64(sin(y) / y))
end
function tmp = code(x, y)
	tmp = x * (sin(y) / y);
end
code[x_, y_] := N[(x * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \frac{\sin y}{y}
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \frac{\sin y}{y} \end{array} \]
(FPCore (x y) :precision binary64 (* x (/ (sin y) y)))
double code(double x, double y) {
	return x * (sin(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 = x * (sin(y) / y)
end function
public static double code(double x, double y) {
	return x * (Math.sin(y) / y);
}
def code(x, y):
	return x * (math.sin(y) / y)
function code(x, y)
	return Float64(x * Float64(sin(y) / y))
end
function tmp = code(x, y)
	tmp = x * (sin(y) / y);
end
code[x_, y_] := N[(x * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \frac{\sin y}{y}
\end{array}
Derivation
  1. Initial program 99.8%

    \[x \cdot \frac{\sin y}{y} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 57.7% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.5:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, \left(y \cdot y\right) \cdot x, -0.16666666666666666 \cdot x\right), y \cdot y, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 4.5)
   (fma
    (fma 0.008333333333333333 (* (* y y) x) (* -0.16666666666666666 x))
    (* y y)
    x)
   (* y (/ x y))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.5) {
		tmp = fma(fma(0.008333333333333333, ((y * y) * x), (-0.16666666666666666 * x)), (y * y), x);
	} else {
		tmp = y * (x / y);
	}
	return tmp;
}
function code(x, y)
	tmp = 0.0
	if (y <= 4.5)
		tmp = fma(fma(0.008333333333333333, Float64(Float64(y * y) * x), Float64(-0.16666666666666666 * x)), Float64(y * y), x);
	else
		tmp = Float64(y * Float64(x / y));
	end
	return tmp
end
code[x_, y_] := If[LessEqual[y, 4.5], N[(N[(0.008333333333333333 * N[(N[(y * y), $MachinePrecision] * x), $MachinePrecision] + N[(-0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, \left(y \cdot y\right) \cdot x, -0.16666666666666666 \cdot x\right), y \cdot y, x\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.5

    1. Initial program 99.9%

      \[x \cdot \frac{\sin y}{y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{x + {y}^{2} \cdot \left(\frac{-1}{6} \cdot x + \frac{1}{120} \cdot \left(x \cdot {y}^{2}\right)\right)} \]
    4. Step-by-step derivation
      1. Applied rewrites66.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, \left(y \cdot y\right) \cdot x, -0.16666666666666666 \cdot x\right), y \cdot y, x\right)} \]

      if 4.5 < y

      1. Initial program 99.5%

        \[x \cdot \frac{\sin y}{y} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

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

          \[\leadsto x \cdot \color{blue}{\frac{\sin y}{y}} \]
        3. lift-sin.f64N/A

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

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

          \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{y} \]
        6. associate-/l*N/A

          \[\leadsto \color{blue}{\sin y \cdot \frac{x}{y}} \]
        7. lower-*.f64N/A

          \[\leadsto \color{blue}{\sin y \cdot \frac{x}{y}} \]
        8. lift-sin.f64N/A

          \[\leadsto \color{blue}{\sin y} \cdot \frac{x}{y} \]
        9. lower-/.f6499.6

          \[\leadsto \sin y \cdot \color{blue}{\frac{x}{y}} \]
      4. Applied rewrites99.6%

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

        \[\leadsto \color{blue}{y} \cdot \frac{x}{y} \]
      6. Step-by-step derivation
        1. Applied rewrites24.6%

          \[\leadsto \color{blue}{y} \cdot \frac{x}{y} \]
      7. Recombined 2 regimes into one program.
      8. Add Preprocessing

      Alternative 3: 57.7% accurate, 3.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.5:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, -0.16666666666666666\right), y \cdot y, 1\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{y}\\ \end{array} \end{array} \]
      (FPCore (x y)
       :precision binary64
       (if (<= y 4.5)
         (*
          (fma (fma (* y y) 0.008333333333333333 -0.16666666666666666) (* y y) 1.0)
          x)
         (* y (/ x y))))
      double code(double x, double y) {
      	double tmp;
      	if (y <= 4.5) {
      		tmp = fma(fma((y * y), 0.008333333333333333, -0.16666666666666666), (y * y), 1.0) * x;
      	} else {
      		tmp = y * (x / y);
      	}
      	return tmp;
      }
      
      function code(x, y)
      	tmp = 0.0
      	if (y <= 4.5)
      		tmp = Float64(fma(fma(Float64(y * y), 0.008333333333333333, -0.16666666666666666), Float64(y * y), 1.0) * x);
      	else
      		tmp = Float64(y * Float64(x / y));
      	end
      	return tmp
      end
      
      code[x_, y_] := If[LessEqual[y, 4.5], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * x), $MachinePrecision], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq 4.5:\\
      \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, -0.16666666666666666\right), y \cdot y, 1\right) \cdot x\\
      
      \mathbf{else}:\\
      \;\;\;\;y \cdot \frac{x}{y}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < 4.5

        1. Initial program 99.9%

          \[x \cdot \frac{\sin y}{y} \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto x \cdot \color{blue}{\left(1 + {y}^{2} \cdot \left(\frac{1}{120} \cdot {y}^{2} - \frac{1}{6}\right)\right)} \]
        4. Step-by-step derivation
          1. Applied rewrites66.0%

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(y \cdot y\right) - 0.16666666666666666, y \cdot y, 1\right)} \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{120} \cdot \left(y \cdot y\right) - \frac{1}{6}, y \cdot y, 1\right) \cdot x} \]
            3. lower-*.f6466.0

              \[\leadsto \color{blue}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(y \cdot y\right) - 0.16666666666666666, y \cdot y, 1\right) \cdot x} \]
          3. Applied rewrites66.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, -0.16666666666666666\right), y \cdot y, 1\right) \cdot x} \]

          if 4.5 < y

          1. Initial program 99.5%

            \[x \cdot \frac{\sin y}{y} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f64N/A

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

              \[\leadsto x \cdot \color{blue}{\frac{\sin y}{y}} \]
            3. lift-sin.f64N/A

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

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

              \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{y} \]
            6. associate-/l*N/A

              \[\leadsto \color{blue}{\sin y \cdot \frac{x}{y}} \]
            7. lower-*.f64N/A

              \[\leadsto \color{blue}{\sin y \cdot \frac{x}{y}} \]
            8. lift-sin.f64N/A

              \[\leadsto \color{blue}{\sin y} \cdot \frac{x}{y} \]
            9. lower-/.f6499.6

              \[\leadsto \sin y \cdot \color{blue}{\frac{x}{y}} \]
          4. Applied rewrites99.6%

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

            \[\leadsto \color{blue}{y} \cdot \frac{x}{y} \]
          6. Step-by-step derivation
            1. Applied rewrites24.6%

              \[\leadsto \color{blue}{y} \cdot \frac{x}{y} \]
          7. Recombined 2 regimes into one program.
          8. Add Preprocessing

          Alternative 4: 57.7% accurate, 5.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.4 \cdot 10^{+24}:\\ \;\;\;\;\mathsf{fma}\left(y, \left(x \cdot y\right) \cdot -0.16666666666666666, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{y}\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= y 4.4e+24) (fma y (* (* x y) -0.16666666666666666) x) (* y (/ x y))))
          double code(double x, double y) {
          	double tmp;
          	if (y <= 4.4e+24) {
          		tmp = fma(y, ((x * y) * -0.16666666666666666), x);
          	} else {
          		tmp = y * (x / y);
          	}
          	return tmp;
          }
          
          function code(x, y)
          	tmp = 0.0
          	if (y <= 4.4e+24)
          		tmp = fma(y, Float64(Float64(x * y) * -0.16666666666666666), x);
          	else
          		tmp = Float64(y * Float64(x / y));
          	end
          	return tmp
          end
          
          code[x_, y_] := If[LessEqual[y, 4.4e+24], N[(y * N[(N[(x * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq 4.4 \cdot 10^{+24}:\\
          \;\;\;\;\mathsf{fma}\left(y, \left(x \cdot y\right) \cdot -0.16666666666666666, x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;y \cdot \frac{x}{y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < 4.40000000000000003e24

            1. Initial program 99.9%

              \[x \cdot \frac{\sin y}{y} \]
            2. Add Preprocessing
            3. Taylor expanded in y around 0

              \[\leadsto \color{blue}{x + \frac{-1}{6} \cdot \left(x \cdot {y}^{2}\right)} \]
            4. Step-by-step derivation
              1. Applied rewrites65.5%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y \cdot y\right) \cdot x, -0.16666666666666666, x\right)} \]
              2. Step-by-step derivation
                1. Applied rewrites65.5%

                  \[\leadsto \mathsf{fma}\left(y, \color{blue}{\left(x \cdot y\right) \cdot -0.16666666666666666}, x\right) \]

                if 4.40000000000000003e24 < y

                1. Initial program 99.5%

                  \[x \cdot \frac{\sin y}{y} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-*.f64N/A

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

                    \[\leadsto x \cdot \color{blue}{\frac{\sin y}{y}} \]
                  3. lift-sin.f64N/A

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

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

                    \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{y} \]
                  6. associate-/l*N/A

                    \[\leadsto \color{blue}{\sin y \cdot \frac{x}{y}} \]
                  7. lower-*.f64N/A

                    \[\leadsto \color{blue}{\sin y \cdot \frac{x}{y}} \]
                  8. lift-sin.f64N/A

                    \[\leadsto \color{blue}{\sin y} \cdot \frac{x}{y} \]
                  9. lower-/.f6499.6

                    \[\leadsto \sin y \cdot \color{blue}{\frac{x}{y}} \]
                4. Applied rewrites99.6%

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

                  \[\leadsto \color{blue}{y} \cdot \frac{x}{y} \]
                6. Step-by-step derivation
                  1. Applied rewrites25.4%

                    \[\leadsto \color{blue}{y} \cdot \frac{x}{y} \]
                7. Recombined 2 regimes into one program.
                8. Add Preprocessing

                Alternative 5: 53.0% accurate, 117.0× speedup?

                \[\begin{array}{l} \\ x \end{array} \]
                (FPCore (x y) :precision binary64 x)
                double code(double x, double y) {
                	return x;
                }
                
                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 = x
                end function
                
                public static double code(double x, double y) {
                	return x;
                }
                
                def code(x, y):
                	return x
                
                function code(x, y)
                	return x
                end
                
                function tmp = code(x, y)
                	tmp = x;
                end
                
                code[x_, y_] := x
                
                \begin{array}{l}
                
                \\
                x
                \end{array}
                
                Derivation
                1. Initial program 99.8%

                  \[x \cdot \frac{\sin y}{y} \]
                2. Add Preprocessing
                3. Taylor expanded in y around 0

                  \[\leadsto \color{blue}{x} \]
                4. Step-by-step derivation
                  1. Applied rewrites49.7%

                    \[\leadsto \color{blue}{x} \]
                  2. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2025026 
                  (FPCore (x y)
                    :name "Linear.Quaternion:$cexp from linear-1.19.1.3"
                    :precision binary64
                    (* x (/ (sin y) y)))