Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B

Percentage Accurate: 85.1% → 95.6%
Time: 5.6s
Alternatives: 8
Speedup: 0.3×

Specification

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

\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\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 8 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 95.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{a - t}\\ t_2 := x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;x + \left(t\_1 \cdot \left(1 - \frac{t}{z}\right)\right) \cdot z\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\left(z - t\right) \cdot t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ y (- a t))) (t_2 (+ x (/ (* y (- z t)) (- a t)))))
   (if (<= t_2 (- INFINITY))
     (+ x (* (* t_1 (- 1.0 (/ t z))) z))
     (if (<= t_2 5e+306) t_2 (* (- z t) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y / (a - t);
	double t_2 = x + ((y * (z - t)) / (a - t));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = x + ((t_1 * (1.0 - (t / z))) * z);
	} else if (t_2 <= 5e+306) {
		tmp = t_2;
	} else {
		tmp = (z - t) * t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y / (a - t);
	double t_2 = x + ((y * (z - t)) / (a - t));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = x + ((t_1 * (1.0 - (t / z))) * z);
	} else if (t_2 <= 5e+306) {
		tmp = t_2;
	} else {
		tmp = (z - t) * t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y / (a - t)
	t_2 = x + ((y * (z - t)) / (a - t))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = x + ((t_1 * (1.0 - (t / z))) * z)
	elif t_2 <= 5e+306:
		tmp = t_2
	else:
		tmp = (z - t) * t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y / Float64(a - t))
	t_2 = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(x + Float64(Float64(t_1 * Float64(1.0 - Float64(t / z))) * z));
	elseif (t_2 <= 5e+306)
		tmp = t_2;
	else
		tmp = Float64(Float64(z - t) * t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y / (a - t);
	t_2 = x + ((y * (z - t)) / (a - t));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = x + ((t_1 * (1.0 - (t / z))) * z);
	elseif (t_2 <= 5e+306)
		tmp = t_2;
	else
		tmp = (z - t) * t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(x + N[(N[(t$95$1 * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+306], t$95$2, N[(N[(z - t), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{a - t}\\
t_2 := x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;x + \left(t\_1 \cdot \left(1 - \frac{t}{z}\right)\right) \cdot z\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot t\_1\\


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

    1. Initial program 46.7%

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

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

        \[\leadsto x + \color{blue}{\left(\left(-1 \cdot \frac{t \cdot y}{z \cdot \left(a - t\right)}\right) \cdot z + \frac{y}{a - t} \cdot z\right)} \]
      2. fp-cancel-sign-sub-invN/A

        \[\leadsto x + \color{blue}{\left(\left(-1 \cdot \frac{t \cdot y}{z \cdot \left(a - t\right)}\right) \cdot z - \left(\mathsf{neg}\left(\frac{y}{a - t}\right)\right) \cdot z\right)} \]
      3. mul-1-negN/A

        \[\leadsto x + \left(\left(-1 \cdot \frac{t \cdot y}{z \cdot \left(a - t\right)}\right) \cdot z - \color{blue}{\left(-1 \cdot \frac{y}{a - t}\right)} \cdot z\right) \]
      4. fp-cancel-sub-sign-invN/A

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

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

        \[\leadsto x + \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot y}{z \cdot \left(a - t\right)}\right)\right)} + \left(\mathsf{neg}\left(-1 \cdot \frac{y}{a - t}\right)\right) \cdot z\right) \]
      7. distribute-rgt-neg-outN/A

        \[\leadsto x + \left(\color{blue}{\left(\mathsf{neg}\left(z \cdot \frac{t \cdot y}{z \cdot \left(a - t\right)}\right)\right)} + \left(\mathsf{neg}\left(-1 \cdot \frac{y}{a - t}\right)\right) \cdot z\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto x + \left(\left(\mathsf{neg}\left(z \cdot \frac{t \cdot y}{z \cdot \left(a - t\right)}\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\left(-1 \cdot \frac{y}{a - t}\right) \cdot z\right)\right)}\right) \]
      9. distribute-neg-inN/A

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

        \[\leadsto x + \left(\mathsf{neg}\left(\left(\color{blue}{\frac{t \cdot y}{z \cdot \left(a - t\right)} \cdot z} + \left(-1 \cdot \frac{y}{a - t}\right) \cdot z\right)\right)\right) \]
      11. distribute-rgt-inN/A

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

        \[\leadsto x + \left(\mathsf{neg}\left(z \cdot \color{blue}{\left(-1 \cdot \frac{y}{a - t} + \frac{t \cdot y}{z \cdot \left(a - t\right)}\right)}\right)\right) \]
    5. Applied rewrites95.8%

      \[\leadsto x + \color{blue}{\left(\frac{y}{a - t} \cdot \left(1 - \frac{t}{z}\right)\right) \cdot z} \]

    if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) < 4.99999999999999993e306

    1. Initial program 99.4%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing

    if 4.99999999999999993e306 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)))

    1. Initial program 39.2%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{a - t}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 96.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+306}\right):\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ (* y (- z t)) (- a t)))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+306)))
     (* (- z t) (/ y (- a t)))
     t_1)))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y * (z - t)) / (a - t));
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+306)) {
		tmp = (z - t) * (y / (a - t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y * (z - t)) / (a - t));
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+306)) {
		tmp = (z - t) * (y / (a - t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y * (z - t)) / (a - t))
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 5e+306):
		tmp = (z - t) * (y / (a - t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t)))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+306))
		tmp = Float64(Float64(z - t) * Float64(y / Float64(a - t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y * (z - t)) / (a - t));
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 5e+306)))
		tmp = (z - t) * (y / (a - t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+306]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+306}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) < -inf.0 or 4.99999999999999993e306 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)))

    1. Initial program 42.1%

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

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

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

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

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

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

        \[\leadsto \left(z - t\right) \cdot \color{blue}{\frac{y}{a - t}} \]
      6. lower--.f6490.0

        \[\leadsto \left(z - t\right) \cdot \frac{y}{\color{blue}{a - t}} \]
    5. Applied rewrites90.0%

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{a - t}} \]

    if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) < 4.99999999999999993e306

    1. Initial program 99.4%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification97.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \leq -\infty \lor \neg \left(x + \frac{y \cdot \left(z - t\right)}{a - t} \leq 5 \cdot 10^{+306}\right):\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 82.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+181} \lor \neg \left(t\_1 \leq 10^{+183}\right):\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{t}{a - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- a t))))
   (if (or (<= t_1 -2e+181) (not (<= t_1 1e+183)))
     (* (- z t) (/ y (- a t)))
     (- x (* y (/ t (- a t)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (a - t);
	double tmp;
	if ((t_1 <= -2e+181) || !(t_1 <= 1e+183)) {
		tmp = (z - t) * (y / (a - t));
	} else {
		tmp = x - (y * (t / (a - 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 - t)
    if ((t_1 <= (-2d+181)) .or. (.not. (t_1 <= 1d+183))) then
        tmp = (z - t) * (y / (a - t))
    else
        tmp = x - (y * (t / (a - 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 - t);
	double tmp;
	if ((t_1 <= -2e+181) || !(t_1 <= 1e+183)) {
		tmp = (z - t) * (y / (a - t));
	} else {
		tmp = x - (y * (t / (a - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / (a - t)
	tmp = 0
	if (t_1 <= -2e+181) or not (t_1 <= 1e+183):
		tmp = (z - t) * (y / (a - t))
	else:
		tmp = x - (y * (t / (a - t)))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / Float64(a - t))
	tmp = 0.0
	if ((t_1 <= -2e+181) || !(t_1 <= 1e+183))
		tmp = Float64(Float64(z - t) * Float64(y / Float64(a - t)));
	else
		tmp = Float64(x - Float64(y * Float64(t / Float64(a - t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (z - t)) / (a - t);
	tmp = 0.0;
	if ((t_1 <= -2e+181) || ~((t_1 <= 1e+183)))
		tmp = (z - t) * (y / (a - t));
	else
		tmp = x - (y * (t / (a - t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+181], N[Not[LessEqual[t$95$1, 1e+183]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+181} \lor \neg \left(t\_1 \leq 10^{+183}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\

\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -1.9999999999999998e181 or 9.99999999999999947e182 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))

    1. Initial program 56.5%

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

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

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

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

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

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

        \[\leadsto \left(z - t\right) \cdot \color{blue}{\frac{y}{a - t}} \]
      6. lower--.f6484.4

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

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{a - t}} \]

    if -1.9999999999999998e181 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 9.99999999999999947e182

    1. Initial program 99.4%

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a - t}} \]
    4. Step-by-step derivation
      1. fp-cancel-sign-sub-invN/A

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

        \[\leadsto x - \color{blue}{1} \cdot \frac{t \cdot y}{a - t} \]
      3. *-lft-identityN/A

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

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

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

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

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

        \[\leadsto x - y \cdot \color{blue}{\frac{t}{a - t}} \]
      9. lower--.f6489.9

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{a - t}} \]
    5. Applied rewrites89.9%

      \[\leadsto \color{blue}{x - y \cdot \frac{t}{a - t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -2 \cdot 10^{+181} \lor \neg \left(\frac{y \cdot \left(z - t\right)}{a - t} \leq 10^{+183}\right):\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{t}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 59.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \leq -\infty:\\ \;\;\;\;\frac{z}{a} \cdot y\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= (+ x (/ (* y (- z t)) (- a t))) (- INFINITY)) (* (/ z a) y) (+ y x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x + ((y * (z - t)) / (a - t))) <= -((double) INFINITY)) {
		tmp = (z / a) * y;
	} else {
		tmp = y + x;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x + ((y * (z - t)) / (a - t))) <= -Double.POSITIVE_INFINITY) {
		tmp = (z / a) * y;
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (x + ((y * (z - t)) / (a - t))) <= -math.inf:
		tmp = (z / a) * y
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) <= Float64(-Inf))
		tmp = Float64(Float64(z / a) * y);
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((x + ((y * (z - t)) / (a - t))) <= -Inf)
		tmp = (z / a) * y;
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \leq -\infty:\\
\;\;\;\;\frac{z}{a} \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) < -inf.0

    1. Initial program 46.7%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} + x \]
      3. *-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{a}}, y, x\right) \]
    5. Applied rewrites70.1%

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

      \[\leadsto \frac{y \cdot z}{\color{blue}{a}} \]
    7. Step-by-step derivation
      1. Applied rewrites41.0%

        \[\leadsto \frac{z \cdot y}{\color{blue}{a}} \]
      2. Step-by-step derivation
        1. Applied rewrites61.6%

          \[\leadsto \color{blue}{\frac{z}{a} \cdot y} \]

        if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)))

        1. Initial program 89.9%

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

          \[\leadsto \color{blue}{x + y} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{y + x} \]
          2. lower-+.f6467.5

            \[\leadsto \color{blue}{y + x} \]
        5. Applied rewrites67.5%

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

      Alternative 5: 59.9% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \leq -\infty:\\ \;\;\;\;\frac{y}{a} \cdot z\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (<= (+ x (/ (* y (- z t)) (- a t))) (- INFINITY)) (* (/ y a) z) (+ y x)))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if ((x + ((y * (z - t)) / (a - t))) <= -((double) INFINITY)) {
      		tmp = (y / a) * z;
      	} else {
      		tmp = y + x;
      	}
      	return tmp;
      }
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if ((x + ((y * (z - t)) / (a - t))) <= -Double.POSITIVE_INFINITY) {
      		tmp = (y / a) * z;
      	} else {
      		tmp = y + x;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if (x + ((y * (z - t)) / (a - t))) <= -math.inf:
      		tmp = (y / a) * z
      	else:
      		tmp = y + x
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) <= Float64(-Inf))
      		tmp = Float64(Float64(y / a) * z);
      	else
      		tmp = Float64(y + x);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if ((x + ((y * (z - t)) / (a - t))) <= -Inf)
      		tmp = (y / a) * z;
      	else
      		tmp = y + x;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision], N[(y + x), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \leq -\infty:\\
      \;\;\;\;\frac{y}{a} \cdot z\\
      
      \mathbf{else}:\\
      \;\;\;\;y + x\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) < -inf.0

        1. Initial program 46.7%

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

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

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

            \[\leadsto \color{blue}{y \cdot \frac{z}{a}} + x \]
          3. *-commutativeN/A

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{a}}, y, x\right) \]
        5. Applied rewrites70.1%

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

          \[\leadsto \frac{y \cdot z}{\color{blue}{a}} \]
        7. Step-by-step derivation
          1. Applied rewrites41.0%

            \[\leadsto \frac{z \cdot y}{\color{blue}{a}} \]
          2. Step-by-step derivation
            1. Applied rewrites61.5%

              \[\leadsto \frac{y}{a} \cdot z \]

            if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)))

            1. Initial program 89.9%

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

              \[\leadsto \color{blue}{x + y} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{y + x} \]
              2. lower-+.f6467.5

                \[\leadsto \color{blue}{y + x} \]
            5. Applied rewrites67.5%

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

          Alternative 6: 76.5% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.15 \cdot 10^{+41} \lor \neg \left(t \leq 8.2 \cdot 10^{+58}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (if (or (<= t -1.15e+41) (not (<= t 8.2e+58))) (+ y x) (fma (/ z a) y x)))
          double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if ((t <= -1.15e+41) || !(t <= 8.2e+58)) {
          		tmp = y + x;
          	} else {
          		tmp = fma((z / a), y, x);
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a)
          	tmp = 0.0
          	if ((t <= -1.15e+41) || !(t <= 8.2e+58))
          		tmp = Float64(y + x);
          	else
          		tmp = fma(Float64(z / a), y, x);
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.15e+41], N[Not[LessEqual[t, 8.2e+58]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;t \leq -1.15 \cdot 10^{+41} \lor \neg \left(t \leq 8.2 \cdot 10^{+58}\right):\\
          \;\;\;\;y + x\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -1.1499999999999999e41 or 8.2e58 < t

            1. Initial program 79.0%

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

              \[\leadsto \color{blue}{x + y} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{y + x} \]
              2. lower-+.f6484.2

                \[\leadsto \color{blue}{y + x} \]
            5. Applied rewrites84.2%

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

            if -1.1499999999999999e41 < t < 8.2e58

            1. Initial program 92.3%

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

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

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

                \[\leadsto \color{blue}{y \cdot \frac{z}{a}} + x \]
              3. *-commutativeN/A

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{a}, y, x\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification81.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.15 \cdot 10^{+41} \lor \neg \left(t \leq 8.2 \cdot 10^{+58}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 7: 77.0% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.15 \cdot 10^{+41} \lor \neg \left(t \leq 225000000000\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (if (or (<= t -1.15e+41) (not (<= t 225000000000.0)))
             (+ y x)
             (fma z (/ y a) x)))
          double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if ((t <= -1.15e+41) || !(t <= 225000000000.0)) {
          		tmp = y + x;
          	} else {
          		tmp = fma(z, (y / a), x);
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a)
          	tmp = 0.0
          	if ((t <= -1.15e+41) || !(t <= 225000000000.0))
          		tmp = Float64(y + x);
          	else
          		tmp = fma(z, Float64(y / a), x);
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.15e+41], N[Not[LessEqual[t, 225000000000.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;t \leq -1.15 \cdot 10^{+41} \lor \neg \left(t \leq 225000000000\right):\\
          \;\;\;\;y + x\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -1.1499999999999999e41 or 2.25e11 < t

            1. Initial program 79.5%

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

              \[\leadsto \color{blue}{x + y} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{y + x} \]
              2. lower-+.f6482.0

                \[\leadsto \color{blue}{y + x} \]
            5. Applied rewrites82.0%

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

            if -1.1499999999999999e41 < t < 2.25e11

            1. Initial program 92.5%

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

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

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

                \[\leadsto \color{blue}{y \cdot \frac{z}{a}} + x \]
              3. *-commutativeN/A

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{a}}, y, x\right) \]
            5. Applied rewrites81.6%

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

                \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{y}{a}}, x\right) \]
            7. Recombined 2 regimes into one program.
            8. Final simplification80.5%

              \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.15 \cdot 10^{+41} \lor \neg \left(t \leq 225000000000\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\ \end{array} \]
            9. Add Preprocessing

            Alternative 8: 60.7% accurate, 6.5× speedup?

            \[\begin{array}{l} \\ y + x \end{array} \]
            (FPCore (x y z t a) :precision binary64 (+ y x))
            double code(double x, double y, double z, double t, double a) {
            	return y + 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 = y + x
            end function
            
            public static double code(double x, double y, double z, double t, double a) {
            	return y + x;
            }
            
            def code(x, y, z, t, a):
            	return y + x
            
            function code(x, y, z, t, a)
            	return Float64(y + x)
            end
            
            function tmp = code(x, y, z, t, a)
            	tmp = y + x;
            end
            
            code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            y + x
            \end{array}
            
            Derivation
            1. Initial program 86.0%

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

              \[\leadsto \color{blue}{x + y} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{y + x} \]
              2. lower-+.f6462.8

                \[\leadsto \color{blue}{y + x} \]
            5. Applied rewrites62.8%

              \[\leadsto \color{blue}{y + x} \]
            6. Add Preprocessing

            Developer Target 1: 98.1% accurate, 0.8× speedup?

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

            Reproduce

            ?
            herbie shell --seed 2025015 
            (FPCore (x y z t a)
              :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
              :precision binary64
            
              :alt
              (! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
            
              (+ x (/ (* y (- z t)) (- a t))))