Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A

Percentage Accurate: 85.6% → 95.7%
Time: 3.5s
Alternatives: 10
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot t}{a - z} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * t) / (a - z));
}
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, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a):
	return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - z) * t) / (a - z));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}

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

\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot t}{a - z} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * t) / (a - z));
}
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, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a):
	return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - z) * t) / (a - z));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}

Alternative 1: 95.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (fma (- y z) (/ t (- a z)) x))
double code(double x, double y, double z, double t, double a) {
	return fma((y - z), (t / (a - z)), x);
}
function code(x, y, z, t, a)
	return fma(Float64(y - z), Float64(t / Float64(a - z)), x)
end
code[x_, y_, z_, t_, a_] := N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)
\end{array}
Derivation
  1. Initial program 85.6%

    \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
  2. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \color{blue}{x + \frac{\left(y - z\right) \cdot t}{a - z}} \]
    2. lift--.f64N/A

      \[\leadsto x + \frac{\left(y - z\right) \cdot t}{\color{blue}{a - z}} \]
    3. lift-/.f64N/A

      \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z}} \]
    4. lift--.f64N/A

      \[\leadsto x + \frac{\color{blue}{\left(y - z\right)} \cdot t}{a - z} \]
    5. lift-*.f64N/A

      \[\leadsto x + \frac{\color{blue}{\left(y - z\right) \cdot t}}{a - z} \]
    6. +-commutativeN/A

      \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z} + x} \]
    7. associate-/l*N/A

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z}} + x \]
    8. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
    9. lift--.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \frac{t}{a - z}, x\right) \]
    10. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t}{a - z}}, x\right) \]
    11. lift--.f6495.7

      \[\leadsto \mathsf{fma}\left(y - z, \frac{t}{\color{blue}{a - z}}, x\right) \]
  3. Applied rewrites95.7%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
  4. Add Preprocessing

Alternative 2: 83.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+104}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t}{a - z}, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -8.0) (+ x t) (if (<= z 3.6e+104) (fma y (/ t (- a z)) x) (+ x t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -8.0) {
		tmp = x + t;
	} else if (z <= 3.6e+104) {
		tmp = fma(y, (t / (a - z)), x);
	} else {
		tmp = x + t;
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -8.0)
		tmp = Float64(x + t);
	elseif (z <= 3.6e+104)
		tmp = fma(y, Float64(t / Float64(a - z)), x);
	else
		tmp = Float64(x + t);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.0], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.6e+104], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a - z}, x\right)\\

\mathbf{else}:\\
\;\;\;\;x + t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8 or 3.60000000000000001e104 < z

    1. Initial program 72.7%

      \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
    2. Taylor expanded in z around inf

      \[\leadsto x + \color{blue}{t} \]
    3. Step-by-step derivation
      1. Applied rewrites78.7%

        \[\leadsto x + \color{blue}{t} \]

      if -8 < z < 3.60000000000000001e104

      1. Initial program 94.7%

        \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{x + \frac{\left(y - z\right) \cdot t}{a - z}} \]
        2. lift--.f64N/A

          \[\leadsto x + \frac{\left(y - z\right) \cdot t}{\color{blue}{a - z}} \]
        3. lift-/.f64N/A

          \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z}} \]
        4. lift--.f64N/A

          \[\leadsto x + \frac{\color{blue}{\left(y - z\right)} \cdot t}{a - z} \]
        5. lift-*.f64N/A

          \[\leadsto x + \frac{\color{blue}{\left(y - z\right) \cdot t}}{a - z} \]
        6. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z} + x} \]
        7. associate-/l*N/A

          \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z}} + x \]
        8. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
        9. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \frac{t}{a - z}, x\right) \]
        10. lower-/.f64N/A

          \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t}{a - z}}, x\right) \]
        11. lift--.f6496.7

          \[\leadsto \mathsf{fma}\left(y - z, \frac{t}{\color{blue}{a - z}}, x\right) \]
      3. Applied rewrites96.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
      4. Taylor expanded in y around inf

        \[\leadsto \mathsf{fma}\left(\color{blue}{y}, \frac{t}{a - z}, x\right) \]
      5. Step-by-step derivation
        1. Applied rewrites87.5%

          \[\leadsto \mathsf{fma}\left(\color{blue}{y}, \frac{t}{a - z}, x\right) \]
      6. Recombined 2 regimes into one program.
      7. Add Preprocessing

      Alternative 3: 78.3% accurate, 0.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+14}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 650000000000:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (<= z -1.7e+14)
         (+ x t)
         (if (<= z 650000000000.0) (fma t (/ (- y z) a) x) (+ x t))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -1.7e+14) {
      		tmp = x + t;
      	} else if (z <= 650000000000.0) {
      		tmp = fma(t, ((y - z) / a), x);
      	} else {
      		tmp = x + t;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (z <= -1.7e+14)
      		tmp = Float64(x + t);
      	elseif (z <= 650000000000.0)
      		tmp = fma(t, Float64(Float64(y - z) / a), x);
      	else
      		tmp = Float64(x + t);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e+14], N[(x + t), $MachinePrecision], If[LessEqual[z, 650000000000.0], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -1.7 \cdot 10^{+14}:\\
      \;\;\;\;x + t\\
      
      \mathbf{elif}\;z \leq 650000000000:\\
      \;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x + t\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.7e14 or 6.5e11 < z

        1. Initial program 74.4%

          \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
        2. Taylor expanded in z around inf

          \[\leadsto x + \color{blue}{t} \]
        3. Step-by-step derivation
          1. Applied rewrites76.5%

            \[\leadsto x + \color{blue}{t} \]

          if -1.7e14 < z < 6.5e11

          1. Initial program 95.7%

            \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
          2. Taylor expanded in a around inf

            \[\leadsto \color{blue}{x + \frac{t \cdot \left(y - z\right)}{a}} \]
          3. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \frac{t \cdot \left(y - z\right)}{a} + \color{blue}{x} \]
            2. associate-/l*N/A

              \[\leadsto t \cdot \frac{y - z}{a} + x \]
            3. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(t, \color{blue}{\frac{y - z}{a}}, x\right) \]
            4. lower-/.f64N/A

              \[\leadsto \mathsf{fma}\left(t, \frac{y - z}{\color{blue}{a}}, x\right) \]
            5. lift--.f6479.8

              \[\leadsto \mathsf{fma}\left(t, \frac{y - z}{a}, x\right) \]
          4. Applied rewrites79.8%

            \[\leadsto \color{blue}{\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)} \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 4: 76.7% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-29}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-155}:\\ \;\;\;\;y \cdot \frac{t}{a} + x\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+104}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t}{-z}, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (if (<= z -5e-29)
           (+ x t)
           (if (<= z 4.4e-155)
             (+ (* y (/ t a)) x)
             (if (<= z 1.1e+104) (fma y (/ t (- z)) x) (+ x t)))))
        double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if (z <= -5e-29) {
        		tmp = x + t;
        	} else if (z <= 4.4e-155) {
        		tmp = (y * (t / a)) + x;
        	} else if (z <= 1.1e+104) {
        		tmp = fma(y, (t / -z), x);
        	} else {
        		tmp = x + t;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a)
        	tmp = 0.0
        	if (z <= -5e-29)
        		tmp = Float64(x + t);
        	elseif (z <= 4.4e-155)
        		tmp = Float64(Float64(y * Float64(t / a)) + x);
        	elseif (z <= 1.1e+104)
        		tmp = fma(y, Float64(t / Float64(-z)), x);
        	else
        		tmp = Float64(x + t);
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-29], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.4e-155], N[(N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.1e+104], N[(y * N[(t / (-z)), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -5 \cdot 10^{-29}:\\
        \;\;\;\;x + t\\
        
        \mathbf{elif}\;z \leq 4.4 \cdot 10^{-155}:\\
        \;\;\;\;y \cdot \frac{t}{a} + x\\
        
        \mathbf{elif}\;z \leq 1.1 \cdot 10^{+104}:\\
        \;\;\;\;\mathsf{fma}\left(y, \frac{t}{-z}, x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;x + t\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < -4.99999999999999986e-29 or 1.1e104 < z

          1. Initial program 73.9%

            \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
          2. Taylor expanded in z around inf

            \[\leadsto x + \color{blue}{t} \]
          3. Step-by-step derivation
            1. Applied rewrites77.3%

              \[\leadsto x + \color{blue}{t} \]

            if -4.99999999999999986e-29 < z < 4.3999999999999998e-155

            1. Initial program 95.5%

              \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
            2. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \color{blue}{x + \frac{\left(y - z\right) \cdot t}{a - z}} \]
              2. lift--.f64N/A

                \[\leadsto x + \frac{\left(y - z\right) \cdot t}{\color{blue}{a - z}} \]
              3. lift-/.f64N/A

                \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z}} \]
              4. lift--.f64N/A

                \[\leadsto x + \frac{\color{blue}{\left(y - z\right)} \cdot t}{a - z} \]
              5. lift-*.f64N/A

                \[\leadsto x + \frac{\color{blue}{\left(y - z\right) \cdot t}}{a - z} \]
              6. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z} + x} \]
              7. associate-/l*N/A

                \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z}} + x \]
              8. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
              9. lift--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \frac{t}{a - z}, x\right) \]
              10. lower-/.f64N/A

                \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t}{a - z}}, x\right) \]
              11. lift--.f6496.0

                \[\leadsto \mathsf{fma}\left(y - z, \frac{t}{\color{blue}{a - z}}, x\right) \]
            3. Applied rewrites96.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
            4. Taylor expanded in y around inf

              \[\leadsto \mathsf{fma}\left(\color{blue}{y}, \frac{t}{a - z}, x\right) \]
            5. Step-by-step derivation
              1. Applied rewrites91.7%

                \[\leadsto \mathsf{fma}\left(\color{blue}{y}, \frac{t}{a - z}, x\right) \]
              2. Taylor expanded in z around 0

                \[\leadsto \mathsf{fma}\left(y, \frac{t}{\color{blue}{a}}, x\right) \]
              3. Step-by-step derivation
                1. Applied rewrites82.2%

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

                    \[\leadsto \color{blue}{y \cdot \frac{t}{a} + x} \]
                  2. lower-+.f64N/A

                    \[\leadsto \color{blue}{y \cdot \frac{t}{a} + x} \]
                  3. lower-*.f6482.2

                    \[\leadsto \color{blue}{y \cdot \frac{t}{a}} + x \]
                3. Applied rewrites82.2%

                  \[\leadsto \color{blue}{y \cdot \frac{t}{a} + x} \]

                if 4.3999999999999998e-155 < z < 1.1e104

                1. Initial program 93.3%

                  \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \color{blue}{x + \frac{\left(y - z\right) \cdot t}{a - z}} \]
                  2. lift--.f64N/A

                    \[\leadsto x + \frac{\left(y - z\right) \cdot t}{\color{blue}{a - z}} \]
                  3. lift-/.f64N/A

                    \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z}} \]
                  4. lift--.f64N/A

                    \[\leadsto x + \frac{\color{blue}{\left(y - z\right)} \cdot t}{a - z} \]
                  5. lift-*.f64N/A

                    \[\leadsto x + \frac{\color{blue}{\left(y - z\right) \cdot t}}{a - z} \]
                  6. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z} + x} \]
                  7. associate-/l*N/A

                    \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z}} + x \]
                  8. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
                  9. lift--.f64N/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \frac{t}{a - z}, x\right) \]
                  10. lower-/.f64N/A

                    \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t}{a - z}}, x\right) \]
                  11. lift--.f6497.8

                    \[\leadsto \mathsf{fma}\left(y - z, \frac{t}{\color{blue}{a - z}}, x\right) \]
                3. Applied rewrites97.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
                4. Taylor expanded in y around inf

                  \[\leadsto \mathsf{fma}\left(\color{blue}{y}, \frac{t}{a - z}, x\right) \]
                5. Step-by-step derivation
                  1. Applied rewrites81.2%

                    \[\leadsto \mathsf{fma}\left(\color{blue}{y}, \frac{t}{a - z}, x\right) \]
                  2. Taylor expanded in z around inf

                    \[\leadsto \mathsf{fma}\left(y, \frac{t}{\color{blue}{-1 \cdot z}}, x\right) \]
                  3. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{fma}\left(y, \frac{t}{\mathsf{neg}\left(z\right)}, x\right) \]
                    2. lower-neg.f6458.8

                      \[\leadsto \mathsf{fma}\left(y, \frac{t}{-z}, x\right) \]
                  4. Applied rewrites58.8%

                    \[\leadsto \mathsf{fma}\left(y, \frac{t}{\color{blue}{-z}}, x\right) \]
                6. Recombined 3 regimes into one program.
                7. Add Preprocessing

                Alternative 5: 76.7% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-29}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 520000000000:\\ \;\;\;\;y \cdot \frac{t}{a} + x\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
                (FPCore (x y z t a)
                 :precision binary64
                 (if (<= z -5e-29)
                   (+ x t)
                   (if (<= z 520000000000.0) (+ (* y (/ t a)) x) (+ x t))))
                double code(double x, double y, double z, double t, double a) {
                	double tmp;
                	if (z <= -5e-29) {
                		tmp = x + t;
                	} else if (z <= 520000000000.0) {
                		tmp = (y * (t / a)) + x;
                	} else {
                		tmp = x + t;
                	}
                	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, z, t, a)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8), intent (in) :: a
                    real(8) :: tmp
                    if (z <= (-5d-29)) then
                        tmp = x + t
                    else if (z <= 520000000000.0d0) then
                        tmp = (y * (t / a)) + x
                    else
                        tmp = x + t
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double t, double a) {
                	double tmp;
                	if (z <= -5e-29) {
                		tmp = x + t;
                	} else if (z <= 520000000000.0) {
                		tmp = (y * (t / a)) + x;
                	} else {
                		tmp = x + t;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t, a):
                	tmp = 0
                	if z <= -5e-29:
                		tmp = x + t
                	elif z <= 520000000000.0:
                		tmp = (y * (t / a)) + x
                	else:
                		tmp = x + t
                	return tmp
                
                function code(x, y, z, t, a)
                	tmp = 0.0
                	if (z <= -5e-29)
                		tmp = Float64(x + t);
                	elseif (z <= 520000000000.0)
                		tmp = Float64(Float64(y * Float64(t / a)) + x);
                	else
                		tmp = Float64(x + t);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t, a)
                	tmp = 0.0;
                	if (z <= -5e-29)
                		tmp = x + t;
                	elseif (z <= 520000000000.0)
                		tmp = (y * (t / a)) + x;
                	else
                		tmp = x + t;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-29], N[(x + t), $MachinePrecision], If[LessEqual[z, 520000000000.0], N[(N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;z \leq -5 \cdot 10^{-29}:\\
                \;\;\;\;x + t\\
                
                \mathbf{elif}\;z \leq 520000000000:\\
                \;\;\;\;y \cdot \frac{t}{a} + x\\
                
                \mathbf{else}:\\
                \;\;\;\;x + t\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if z < -4.99999999999999986e-29 or 5.2e11 < z

                  1. Initial program 76.0%

                    \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                  2. Taylor expanded in z around inf

                    \[\leadsto x + \color{blue}{t} \]
                  3. Step-by-step derivation
                    1. Applied rewrites75.0%

                      \[\leadsto x + \color{blue}{t} \]

                    if -4.99999999999999986e-29 < z < 5.2e11

                    1. Initial program 95.6%

                      \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                    2. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto \color{blue}{x + \frac{\left(y - z\right) \cdot t}{a - z}} \]
                      2. lift--.f64N/A

                        \[\leadsto x + \frac{\left(y - z\right) \cdot t}{\color{blue}{a - z}} \]
                      3. lift-/.f64N/A

                        \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z}} \]
                      4. lift--.f64N/A

                        \[\leadsto x + \frac{\color{blue}{\left(y - z\right)} \cdot t}{a - z} \]
                      5. lift-*.f64N/A

                        \[\leadsto x + \frac{\color{blue}{\left(y - z\right) \cdot t}}{a - z} \]
                      6. +-commutativeN/A

                        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z} + x} \]
                      7. associate-/l*N/A

                        \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z}} + x \]
                      8. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
                      9. lift--.f64N/A

                        \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \frac{t}{a - z}, x\right) \]
                      10. lower-/.f64N/A

                        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t}{a - z}}, x\right) \]
                      11. lift--.f6496.2

                        \[\leadsto \mathsf{fma}\left(y - z, \frac{t}{\color{blue}{a - z}}, x\right) \]
                    3. Applied rewrites96.2%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
                    4. Taylor expanded in y around inf

                      \[\leadsto \mathsf{fma}\left(\color{blue}{y}, \frac{t}{a - z}, x\right) \]
                    5. Step-by-step derivation
                      1. Applied rewrites89.8%

                        \[\leadsto \mathsf{fma}\left(\color{blue}{y}, \frac{t}{a - z}, x\right) \]
                      2. Taylor expanded in z around 0

                        \[\leadsto \mathsf{fma}\left(y, \frac{t}{\color{blue}{a}}, x\right) \]
                      3. Step-by-step derivation
                        1. Applied rewrites78.4%

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

                            \[\leadsto \color{blue}{y \cdot \frac{t}{a} + x} \]
                          2. lower-+.f64N/A

                            \[\leadsto \color{blue}{y \cdot \frac{t}{a} + x} \]
                          3. lower-*.f6478.4

                            \[\leadsto \color{blue}{y \cdot \frac{t}{a}} + x \]
                        3. Applied rewrites78.4%

                          \[\leadsto \color{blue}{y \cdot \frac{t}{a} + x} \]
                      4. Recombined 2 regimes into one program.
                      5. Add Preprocessing

                      Alternative 6: 76.7% accurate, 0.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-29}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 520000000000:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
                      (FPCore (x y z t a)
                       :precision binary64
                       (if (<= z -5e-29)
                         (+ x t)
                         (if (<= z 520000000000.0) (fma y (/ t a) x) (+ x t))))
                      double code(double x, double y, double z, double t, double a) {
                      	double tmp;
                      	if (z <= -5e-29) {
                      		tmp = x + t;
                      	} else if (z <= 520000000000.0) {
                      		tmp = fma(y, (t / a), x);
                      	} else {
                      		tmp = x + t;
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t, a)
                      	tmp = 0.0
                      	if (z <= -5e-29)
                      		tmp = Float64(x + t);
                      	elseif (z <= 520000000000.0)
                      		tmp = fma(y, Float64(t / a), x);
                      	else
                      		tmp = Float64(x + t);
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-29], N[(x + t), $MachinePrecision], If[LessEqual[z, 520000000000.0], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;z \leq -5 \cdot 10^{-29}:\\
                      \;\;\;\;x + t\\
                      
                      \mathbf{elif}\;z \leq 520000000000:\\
                      \;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x + t\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if z < -4.99999999999999986e-29 or 5.2e11 < z

                        1. Initial program 76.0%

                          \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                        2. Taylor expanded in z around inf

                          \[\leadsto x + \color{blue}{t} \]
                        3. Step-by-step derivation
                          1. Applied rewrites75.0%

                            \[\leadsto x + \color{blue}{t} \]

                          if -4.99999999999999986e-29 < z < 5.2e11

                          1. Initial program 95.6%

                            \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                          2. Step-by-step derivation
                            1. lift-+.f64N/A

                              \[\leadsto \color{blue}{x + \frac{\left(y - z\right) \cdot t}{a - z}} \]
                            2. lift--.f64N/A

                              \[\leadsto x + \frac{\left(y - z\right) \cdot t}{\color{blue}{a - z}} \]
                            3. lift-/.f64N/A

                              \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z}} \]
                            4. lift--.f64N/A

                              \[\leadsto x + \frac{\color{blue}{\left(y - z\right)} \cdot t}{a - z} \]
                            5. lift-*.f64N/A

                              \[\leadsto x + \frac{\color{blue}{\left(y - z\right) \cdot t}}{a - z} \]
                            6. +-commutativeN/A

                              \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot t}{a - z} + x} \]
                            7. associate-/l*N/A

                              \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z}} + x \]
                            8. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
                            9. lift--.f64N/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \frac{t}{a - z}, x\right) \]
                            10. lower-/.f64N/A

                              \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t}{a - z}}, x\right) \]
                            11. lift--.f6496.2

                              \[\leadsto \mathsf{fma}\left(y - z, \frac{t}{\color{blue}{a - z}}, x\right) \]
                          3. Applied rewrites96.2%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)} \]
                          4. Taylor expanded in y around inf

                            \[\leadsto \mathsf{fma}\left(\color{blue}{y}, \frac{t}{a - z}, x\right) \]
                          5. Step-by-step derivation
                            1. Applied rewrites89.8%

                              \[\leadsto \mathsf{fma}\left(\color{blue}{y}, \frac{t}{a - z}, x\right) \]
                            2. Taylor expanded in z around 0

                              \[\leadsto \mathsf{fma}\left(y, \frac{t}{\color{blue}{a}}, x\right) \]
                            3. Step-by-step derivation
                              1. Applied rewrites78.4%

                                \[\leadsto \mathsf{fma}\left(y, \frac{t}{\color{blue}{a}}, x\right) \]
                            4. Recombined 2 regimes into one program.
                            5. Add Preprocessing

                            Alternative 7: 75.2% accurate, 0.9× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-30}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 520000000000:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
                            (FPCore (x y z t a)
                             :precision binary64
                             (if (<= z -1.35e-30)
                               (+ x t)
                               (if (<= z 520000000000.0) (fma t (/ y a) x) (+ x t))))
                            double code(double x, double y, double z, double t, double a) {
                            	double tmp;
                            	if (z <= -1.35e-30) {
                            		tmp = x + t;
                            	} else if (z <= 520000000000.0) {
                            		tmp = fma(t, (y / a), x);
                            	} else {
                            		tmp = x + t;
                            	}
                            	return tmp;
                            }
                            
                            function code(x, y, z, t, a)
                            	tmp = 0.0
                            	if (z <= -1.35e-30)
                            		tmp = Float64(x + t);
                            	elseif (z <= 520000000000.0)
                            		tmp = fma(t, Float64(y / a), x);
                            	else
                            		tmp = Float64(x + t);
                            	end
                            	return tmp
                            end
                            
                            code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e-30], N[(x + t), $MachinePrecision], If[LessEqual[z, 520000000000.0], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;z \leq -1.35 \cdot 10^{-30}:\\
                            \;\;\;\;x + t\\
                            
                            \mathbf{elif}\;z \leq 520000000000:\\
                            \;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;x + t\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if z < -1.34999999999999994e-30 or 5.2e11 < z

                              1. Initial program 76.0%

                                \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                              2. Taylor expanded in z around inf

                                \[\leadsto x + \color{blue}{t} \]
                              3. Step-by-step derivation
                                1. Applied rewrites75.0%

                                  \[\leadsto x + \color{blue}{t} \]

                                if -1.34999999999999994e-30 < z < 5.2e11

                                1. Initial program 95.6%

                                  \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                                2. Taylor expanded in z around 0

                                  \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
                                3. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \frac{t \cdot y}{a} + \color{blue}{x} \]
                                  2. associate-/l*N/A

                                    \[\leadsto t \cdot \frac{y}{a} + x \]
                                  3. lower-fma.f64N/A

                                    \[\leadsto \mathsf{fma}\left(t, \color{blue}{\frac{y}{a}}, x\right) \]
                                  4. lower-/.f6478.5

                                    \[\leadsto \mathsf{fma}\left(t, \frac{y}{\color{blue}{a}}, x\right) \]
                                4. Applied rewrites78.5%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(t, \frac{y}{a}, x\right)} \]
                              4. Recombined 2 regimes into one program.
                              5. Add Preprocessing

                              Alternative 8: 62.8% accurate, 1.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-99}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
                              (FPCore (x y z t a)
                               :precision binary64
                               (if (<= z -3e-99) (+ x t) (if (<= z 4.2e-14) x (+ x t))))
                              double code(double x, double y, double z, double t, double a) {
                              	double tmp;
                              	if (z <= -3e-99) {
                              		tmp = x + t;
                              	} else if (z <= 4.2e-14) {
                              		tmp = x;
                              	} else {
                              		tmp = x + t;
                              	}
                              	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, z, t, a)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  real(8), intent (in) :: z
                                  real(8), intent (in) :: t
                                  real(8), intent (in) :: a
                                  real(8) :: tmp
                                  if (z <= (-3d-99)) then
                                      tmp = x + t
                                  else if (z <= 4.2d-14) then
                                      tmp = x
                                  else
                                      tmp = x + t
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double x, double y, double z, double t, double a) {
                              	double tmp;
                              	if (z <= -3e-99) {
                              		tmp = x + t;
                              	} else if (z <= 4.2e-14) {
                              		tmp = x;
                              	} else {
                              		tmp = x + t;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z, t, a):
                              	tmp = 0
                              	if z <= -3e-99:
                              		tmp = x + t
                              	elif z <= 4.2e-14:
                              		tmp = x
                              	else:
                              		tmp = x + t
                              	return tmp
                              
                              function code(x, y, z, t, a)
                              	tmp = 0.0
                              	if (z <= -3e-99)
                              		tmp = Float64(x + t);
                              	elseif (z <= 4.2e-14)
                              		tmp = x;
                              	else
                              		tmp = Float64(x + t);
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, y, z, t, a)
                              	tmp = 0.0;
                              	if (z <= -3e-99)
                              		tmp = x + t;
                              	elseif (z <= 4.2e-14)
                              		tmp = x;
                              	else
                              		tmp = x + t;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3e-99], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.2e-14], x, N[(x + t), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;z \leq -3 \cdot 10^{-99}:\\
                              \;\;\;\;x + t\\
                              
                              \mathbf{elif}\;z \leq 4.2 \cdot 10^{-14}:\\
                              \;\;\;\;x\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;x + t\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if z < -3.00000000000000006e-99 or 4.1999999999999998e-14 < z

                                1. Initial program 78.7%

                                  \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                                2. Taylor expanded in z around inf

                                  \[\leadsto x + \color{blue}{t} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites72.0%

                                    \[\leadsto x + \color{blue}{t} \]

                                  if -3.00000000000000006e-99 < z < 4.1999999999999998e-14

                                  1. Initial program 95.3%

                                    \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                                  2. Taylor expanded in x around inf

                                    \[\leadsto \color{blue}{x} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites50.1%

                                      \[\leadsto \color{blue}{x} \]
                                  4. Recombined 2 regimes into one program.
                                  5. Add Preprocessing

                                  Alternative 9: 55.1% accurate, 0.5× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+195}:\\ \;\;\;\;t\\ \mathbf{elif}\;t\_1 \leq 10^{+106}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
                                  (FPCore (x y z t a)
                                   :precision binary64
                                   (let* ((t_1 (/ (* (- y z) t) (- a z))))
                                     (if (<= t_1 -1e+195) t (if (<= t_1 1e+106) x t))))
                                  double code(double x, double y, double z, double t, double a) {
                                  	double t_1 = ((y - z) * t) / (a - z);
                                  	double tmp;
                                  	if (t_1 <= -1e+195) {
                                  		tmp = t;
                                  	} else if (t_1 <= 1e+106) {
                                  		tmp = x;
                                  	} else {
                                  		tmp = t;
                                  	}
                                  	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, z, t, a)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      real(8), intent (in) :: z
                                      real(8), intent (in) :: t
                                      real(8), intent (in) :: a
                                      real(8) :: t_1
                                      real(8) :: tmp
                                      t_1 = ((y - z) * t) / (a - z)
                                      if (t_1 <= (-1d+195)) then
                                          tmp = t
                                      else if (t_1 <= 1d+106) then
                                          tmp = x
                                      else
                                          tmp = t
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double x, double y, double z, double t, double a) {
                                  	double t_1 = ((y - z) * t) / (a - z);
                                  	double tmp;
                                  	if (t_1 <= -1e+195) {
                                  		tmp = t;
                                  	} else if (t_1 <= 1e+106) {
                                  		tmp = x;
                                  	} else {
                                  		tmp = t;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x, y, z, t, a):
                                  	t_1 = ((y - z) * t) / (a - z)
                                  	tmp = 0
                                  	if t_1 <= -1e+195:
                                  		tmp = t
                                  	elif t_1 <= 1e+106:
                                  		tmp = x
                                  	else:
                                  		tmp = t
                                  	return tmp
                                  
                                  function code(x, y, z, t, a)
                                  	t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z))
                                  	tmp = 0.0
                                  	if (t_1 <= -1e+195)
                                  		tmp = t;
                                  	elseif (t_1 <= 1e+106)
                                  		tmp = x;
                                  	else
                                  		tmp = t;
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x, y, z, t, a)
                                  	t_1 = ((y - z) * t) / (a - z);
                                  	tmp = 0.0;
                                  	if (t_1 <= -1e+195)
                                  		tmp = t;
                                  	elseif (t_1 <= 1e+106)
                                  		tmp = x;
                                  	else
                                  		tmp = t;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+195], t, If[LessEqual[t$95$1, 1e+106], x, t]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
                                  \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+195}:\\
                                  \;\;\;\;t\\
                                  
                                  \mathbf{elif}\;t\_1 \leq 10^{+106}:\\
                                  \;\;\;\;x\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;t\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -9.99999999999999977e194 or 1.00000000000000009e106 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))

                                    1. Initial program 57.7%

                                      \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                                    2. Taylor expanded in x around 0

                                      \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                                    3. Step-by-step derivation
                                      1. *-commutativeN/A

                                        \[\leadsto \frac{\left(y - z\right) \cdot t}{\color{blue}{a} - z} \]
                                      2. associate-/l*N/A

                                        \[\leadsto \left(y - z\right) \cdot \color{blue}{\frac{t}{a - z}} \]
                                      3. lower-*.f64N/A

                                        \[\leadsto \left(y - z\right) \cdot \color{blue}{\frac{t}{a - z}} \]
                                      4. lift--.f64N/A

                                        \[\leadsto \left(y - z\right) \cdot \frac{\color{blue}{t}}{a - z} \]
                                      5. lower-/.f64N/A

                                        \[\leadsto \left(y - z\right) \cdot \frac{t}{\color{blue}{a - z}} \]
                                      6. lift--.f6483.8

                                        \[\leadsto \left(y - z\right) \cdot \frac{t}{a - \color{blue}{z}} \]
                                    4. Applied rewrites83.8%

                                      \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z}} \]
                                    5. Taylor expanded in z around inf

                                      \[\leadsto t \]
                                    6. Step-by-step derivation
                                      1. associate-*r/29.6

                                        \[\leadsto t \]
                                    7. Applied rewrites29.6%

                                      \[\leadsto t \]

                                    if -9.99999999999999977e194 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.00000000000000009e106

                                    1. Initial program 99.6%

                                      \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                                    2. Taylor expanded in x around inf

                                      \[\leadsto \color{blue}{x} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites67.8%

                                        \[\leadsto \color{blue}{x} \]
                                    4. Recombined 2 regimes into one program.
                                    5. Add Preprocessing

                                    Alternative 10: 50.0% accurate, 26.0× speedup?

                                    \[\begin{array}{l} \\ x \end{array} \]
                                    (FPCore (x y z t a) :precision binary64 x)
                                    double code(double x, double y, double z, double t, double a) {
                                    	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, z, t, a)
                                    use fmin_fmax_functions
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        real(8), intent (in) :: z
                                        real(8), intent (in) :: t
                                        real(8), intent (in) :: a
                                        code = x
                                    end function
                                    
                                    public static double code(double x, double y, double z, double t, double a) {
                                    	return x;
                                    }
                                    
                                    def code(x, y, z, t, a):
                                    	return x
                                    
                                    function code(x, y, z, t, a)
                                    	return x
                                    end
                                    
                                    function tmp = code(x, y, z, t, a)
                                    	tmp = x;
                                    end
                                    
                                    code[x_, y_, z_, t_, a_] := x
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    x
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 85.6%

                                      \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
                                    2. Taylor expanded in x around inf

                                      \[\leadsto \color{blue}{x} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites50.0%

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

                                      Reproduce

                                      ?
                                      herbie shell --seed 2025101 
                                      (FPCore (x y z t a)
                                        :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
                                        :precision binary64
                                        (+ x (/ (* (- y z) t) (- a z))))