Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A

Percentage Accurate: 99.0% → 98.8%
Time: 8.1s
Alternatives: 10
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \end{array} \]
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t):
	return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t)
	return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t))))
end
function tmp = code(x, y, z, t)
	tmp = 1.0 - (x / ((y - z) * (y - t)));
end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

\[\begin{array}{l} \\ 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \end{array} \]
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t):
	return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t)
	return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t))))
end
function tmp = code(x, y, z, t)
	tmp = 1.0 - (x / ((y - z) * (y - t)));
end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 98.8% accurate, 0.9× speedup?

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

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

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

      \[\leadsto \color{blue}{1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}} \]
    2. sub-negN/A

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{1}{\mathsf{neg}\left(\left(y - z\right) \cdot \left(y - t\right)\right)}, 1\right)} \]
    8. frac-2negN/A

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

      \[\leadsto \mathsf{fma}\left(x, \frac{\color{blue}{-1}}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(y - z\right) \cdot \left(y - t\right)\right)\right)\right)}, 1\right) \]
    10. remove-double-negN/A

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

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

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

      \[\leadsto \mathsf{fma}\left(x, \frac{-1}{\color{blue}{\left(y - t\right) \cdot \left(y - z\right)}}, 1\right) \]
    14. lower-*.f6499.5

      \[\leadsto \mathsf{fma}\left(x, \frac{-1}{\color{blue}{\left(y - t\right) \cdot \left(y - z\right)}}, 1\right) \]
  4. Applied rewrites99.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{-1}{\left(y - t\right) \cdot \left(y - z\right)}, 1\right)} \]
  5. Final simplification99.5%

    \[\leadsto \mathsf{fma}\left(x, \frac{-1}{\left(z - y\right) \cdot \left(t - y\right)}, 1\right) \]
  6. Add Preprocessing

Alternative 2: 84.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 - \frac{x}{z \cdot t}\\ t_2 := 1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)}\\ \mathbf{if}\;t\_2 \leq -5000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- 1.0 (/ x (* z t)))) (t_2 (- 1.0 (/ x (* (- z y) (- t y))))))
   (if (<= t_2 -5000000000.0) t_1 (if (<= t_2 2.0) 1.0 t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = 1.0 - (x / (z * t));
	double t_2 = 1.0 - (x / ((z - y) * (t - y)));
	double tmp;
	if (t_2 <= -5000000000.0) {
		tmp = t_1;
	} else if (t_2 <= 2.0) {
		tmp = 1.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 1.0d0 - (x / (z * t))
    t_2 = 1.0d0 - (x / ((z - y) * (t - y)))
    if (t_2 <= (-5000000000.0d0)) then
        tmp = t_1
    else if (t_2 <= 2.0d0) then
        tmp = 1.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 1.0 - (x / (z * t));
	double t_2 = 1.0 - (x / ((z - y) * (t - y)));
	double tmp;
	if (t_2 <= -5000000000.0) {
		tmp = t_1;
	} else if (t_2 <= 2.0) {
		tmp = 1.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 1.0 - (x / (z * t))
	t_2 = 1.0 - (x / ((z - y) * (t - y)))
	tmp = 0
	if t_2 <= -5000000000.0:
		tmp = t_1
	elif t_2 <= 2.0:
		tmp = 1.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(1.0 - Float64(x / Float64(z * t)))
	t_2 = Float64(1.0 - Float64(x / Float64(Float64(z - y) * Float64(t - y))))
	tmp = 0.0
	if (t_2 <= -5000000000.0)
		tmp = t_1;
	elseif (t_2 <= 2.0)
		tmp = 1.0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 1.0 - (x / (z * t));
	t_2 = 1.0 - (x / ((z - y) * (t - y)));
	tmp = 0.0;
	if (t_2 <= -5000000000.0)
		tmp = t_1;
	elseif (t_2 <= 2.0)
		tmp = 1.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(x / N[(N[(z - y), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5000000000.0], t$95$1, If[LessEqual[t$95$2, 2.0], 1.0, t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 2:\\
\;\;\;\;1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -5e9 or 2 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))))

    1. Initial program 98.4%

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

      \[\leadsto 1 - \frac{x}{\color{blue}{t \cdot z}} \]
    4. Step-by-step derivation
      1. lower-*.f6445.2

        \[\leadsto 1 - \frac{x}{\color{blue}{t \cdot z}} \]
    5. Applied rewrites45.2%

      \[\leadsto 1 - \frac{x}{\color{blue}{t \cdot z}} \]

    if -5e9 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 2

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{1} \]
    4. Step-by-step derivation
      1. Applied rewrites99.5%

        \[\leadsto \color{blue}{1} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification83.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)} \leq -5000000000:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{elif}\;1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)} \leq 2:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 80.0% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t \cdot y} + 1\\ t_2 := 1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)}\\ \mathbf{if}\;t\_2 \leq 0.9995:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+48}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (+ (/ x (* t y)) 1.0)) (t_2 (- 1.0 (/ x (* (- z y) (- t y))))))
       (if (<= t_2 0.9995) t_1 (if (<= t_2 1e+48) 1.0 t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = (x / (t * y)) + 1.0;
    	double t_2 = 1.0 - (x / ((z - y) * (t - y)));
    	double tmp;
    	if (t_2 <= 0.9995) {
    		tmp = t_1;
    	} else if (t_2 <= 1e+48) {
    		tmp = 1.0;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: t_1
        real(8) :: t_2
        real(8) :: tmp
        t_1 = (x / (t * y)) + 1.0d0
        t_2 = 1.0d0 - (x / ((z - y) * (t - y)))
        if (t_2 <= 0.9995d0) then
            tmp = t_1
        else if (t_2 <= 1d+48) then
            tmp = 1.0d0
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double t_1 = (x / (t * y)) + 1.0;
    	double t_2 = 1.0 - (x / ((z - y) * (t - y)));
    	double tmp;
    	if (t_2 <= 0.9995) {
    		tmp = t_1;
    	} else if (t_2 <= 1e+48) {
    		tmp = 1.0;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = (x / (t * y)) + 1.0
    	t_2 = 1.0 - (x / ((z - y) * (t - y)))
    	tmp = 0
    	if t_2 <= 0.9995:
    		tmp = t_1
    	elif t_2 <= 1e+48:
    		tmp = 1.0
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(x / Float64(t * y)) + 1.0)
    	t_2 = Float64(1.0 - Float64(x / Float64(Float64(z - y) * Float64(t - y))))
    	tmp = 0.0
    	if (t_2 <= 0.9995)
    		tmp = t_1;
    	elseif (t_2 <= 1e+48)
    		tmp = 1.0;
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = (x / (t * y)) + 1.0;
    	t_2 = 1.0 - (x / ((z - y) * (t - y)));
    	tmp = 0.0;
    	if (t_2 <= 0.9995)
    		tmp = t_1;
    	elseif (t_2 <= 1e+48)
    		tmp = 1.0;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(x / N[(N[(z - y), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.9995], t$95$1, If[LessEqual[t$95$2, 1e+48], 1.0, t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{x}{t \cdot y} + 1\\
    t_2 := 1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)}\\
    \mathbf{if}\;t\_2 \leq 0.9995:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_2 \leq 10^{+48}:\\
    \;\;\;\;1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 0.99950000000000006 or 1.00000000000000004e48 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))))

      1. Initial program 98.3%

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

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

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

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

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

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

          \[\leadsto \frac{x}{\color{blue}{\left(y - z\right) \cdot t}} + 1 \]
        6. lower--.f6457.0

          \[\leadsto \frac{x}{\color{blue}{\left(y - z\right)} \cdot t} + 1 \]
      5. Applied rewrites57.0%

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

        \[\leadsto \frac{x}{t \cdot y} + 1 \]
      7. Step-by-step derivation
        1. Applied rewrites26.8%

          \[\leadsto \frac{x}{t \cdot y} + 1 \]

        if 0.99950000000000006 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 1.00000000000000004e48

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{1} \]
        4. Step-by-step derivation
          1. Applied rewrites96.9%

            \[\leadsto \color{blue}{1} \]
        5. Recombined 2 regimes into one program.
        6. Final simplification77.2%

          \[\leadsto \begin{array}{l} \mathbf{if}\;1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)} \leq 0.9995:\\ \;\;\;\;\frac{x}{t \cdot y} + 1\\ \mathbf{elif}\;1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)} \leq 10^{+48}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y} + 1\\ \end{array} \]
        7. Add Preprocessing

        Alternative 4: 80.3% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{z \cdot y} + 1\\ t_2 := 1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)}\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+48}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (+ (/ x (* z y)) 1.0)) (t_2 (- 1.0 (/ x (* (- z y) (- t y))))))
           (if (<= t_2 -2e+20) t_1 (if (<= t_2 5e+48) 1.0 t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = (x / (z * y)) + 1.0;
        	double t_2 = 1.0 - (x / ((z - y) * (t - y)));
        	double tmp;
        	if (t_2 <= -2e+20) {
        		tmp = t_1;
        	} else if (t_2 <= 5e+48) {
        		tmp = 1.0;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        real(8) function code(x, y, z, t)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8) :: t_1
            real(8) :: t_2
            real(8) :: tmp
            t_1 = (x / (z * y)) + 1.0d0
            t_2 = 1.0d0 - (x / ((z - y) * (t - y)))
            if (t_2 <= (-2d+20)) then
                tmp = t_1
            else if (t_2 <= 5d+48) then
                tmp = 1.0d0
            else
                tmp = t_1
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double t_1 = (x / (z * y)) + 1.0;
        	double t_2 = 1.0 - (x / ((z - y) * (t - y)));
        	double tmp;
        	if (t_2 <= -2e+20) {
        		tmp = t_1;
        	} else if (t_2 <= 5e+48) {
        		tmp = 1.0;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = (x / (z * y)) + 1.0
        	t_2 = 1.0 - (x / ((z - y) * (t - y)))
        	tmp = 0
        	if t_2 <= -2e+20:
        		tmp = t_1
        	elif t_2 <= 5e+48:
        		tmp = 1.0
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = Float64(Float64(x / Float64(z * y)) + 1.0)
        	t_2 = Float64(1.0 - Float64(x / Float64(Float64(z - y) * Float64(t - y))))
        	tmp = 0.0
        	if (t_2 <= -2e+20)
        		tmp = t_1;
        	elseif (t_2 <= 5e+48)
        		tmp = 1.0;
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = (x / (z * y)) + 1.0;
        	t_2 = 1.0 - (x / ((z - y) * (t - y)));
        	tmp = 0.0;
        	if (t_2 <= -2e+20)
        		tmp = t_1;
        	elseif (t_2 <= 5e+48)
        		tmp = 1.0;
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(x / N[(N[(z - y), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+20], t$95$1, If[LessEqual[t$95$2, 5e+48], 1.0, t$95$1]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \frac{x}{z \cdot y} + 1\\
        t_2 := 1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)}\\
        \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+20}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+48}:\\
        \;\;\;\;1\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -2e20 or 4.99999999999999973e48 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))))

          1. Initial program 98.2%

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

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

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

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

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

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

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

              \[\leadsto \frac{x}{\color{blue}{\left(y - t\right)} \cdot z} + 1 \]
          5. Applied rewrites64.6%

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

            \[\leadsto \frac{x}{y \cdot z} + 1 \]
          7. Step-by-step derivation
            1. Applied rewrites32.4%

              \[\leadsto \frac{x}{z \cdot y} + 1 \]

            if -2e20 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 4.99999999999999973e48

            1. Initial program 100.0%

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

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

                \[\leadsto \color{blue}{1} \]
            5. Recombined 2 regimes into one program.
            6. Final simplification78.4%

              \[\leadsto \begin{array}{l} \mathbf{if}\;1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)} \leq -2 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{z \cdot y} + 1\\ \mathbf{elif}\;1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)} \leq 5 \cdot 10^{+48}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot y} + 1\\ \end{array} \]
            7. Add Preprocessing

            Alternative 5: 89.0% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 - \frac{x}{\left(y - z\right) \cdot y}\\ \mathbf{if}\;y \leq -3.05 \cdot 10^{-31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-39}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t} + 1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (- 1.0 (/ x (* (- y z) y)))))
               (if (<= y -3.05e-31)
                 t_1
                 (if (<= y 7.5e-39) (+ (/ x (* (- y z) t)) 1.0) t_1))))
            double code(double x, double y, double z, double t) {
            	double t_1 = 1.0 - (x / ((y - z) * y));
            	double tmp;
            	if (y <= -3.05e-31) {
            		tmp = t_1;
            	} else if (y <= 7.5e-39) {
            		tmp = (x / ((y - z) * t)) + 1.0;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: t_1
                real(8) :: tmp
                t_1 = 1.0d0 - (x / ((y - z) * y))
                if (y <= (-3.05d-31)) then
                    tmp = t_1
                else if (y <= 7.5d-39) then
                    tmp = (x / ((y - z) * t)) + 1.0d0
                else
                    tmp = t_1
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double t_1 = 1.0 - (x / ((y - z) * y));
            	double tmp;
            	if (y <= -3.05e-31) {
            		tmp = t_1;
            	} else if (y <= 7.5e-39) {
            		tmp = (x / ((y - z) * t)) + 1.0;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	t_1 = 1.0 - (x / ((y - z) * y))
            	tmp = 0
            	if y <= -3.05e-31:
            		tmp = t_1
            	elif y <= 7.5e-39:
            		tmp = (x / ((y - z) * t)) + 1.0
            	else:
            		tmp = t_1
            	return tmp
            
            function code(x, y, z, t)
            	t_1 = Float64(1.0 - Float64(x / Float64(Float64(y - z) * y)))
            	tmp = 0.0
            	if (y <= -3.05e-31)
            		tmp = t_1;
            	elseif (y <= 7.5e-39)
            		tmp = Float64(Float64(x / Float64(Float64(y - z) * t)) + 1.0);
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	t_1 = 1.0 - (x / ((y - z) * y));
            	tmp = 0.0;
            	if (y <= -3.05e-31)
            		tmp = t_1;
            	elseif (y <= 7.5e-39)
            		tmp = (x / ((y - z) * t)) + 1.0;
            	else
            		tmp = t_1;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.05e-31], t$95$1, If[LessEqual[y, 7.5e-39], N[(N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := 1 - \frac{x}{\left(y - z\right) \cdot y}\\
            \mathbf{if}\;y \leq -3.05 \cdot 10^{-31}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;y \leq 7.5 \cdot 10^{-39}:\\
            \;\;\;\;\frac{x}{\left(y - z\right) \cdot t} + 1\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -3.0499999999999999e-31 or 7.49999999999999971e-39 < y

              1. Initial program 99.9%

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

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

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

                  \[\leadsto 1 - \frac{x}{\color{blue}{\left(y - z\right) \cdot y}} \]
                3. lower--.f6495.8

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

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

              if -3.0499999999999999e-31 < y < 7.49999999999999971e-39

              1. Initial program 99.1%

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

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

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

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

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

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

                  \[\leadsto \frac{x}{\color{blue}{\left(y - z\right) \cdot t}} + 1 \]
                6. lower--.f6482.3

                  \[\leadsto \frac{x}{\color{blue}{\left(y - z\right)} \cdot t} + 1 \]
              5. Applied rewrites82.3%

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

            Alternative 6: 86.0% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 - \frac{x}{y \cdot y}\\ \mathbf{if}\;y \leq -5.8 \cdot 10^{-31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t} + 1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (- 1.0 (/ x (* y y)))))
               (if (<= y -5.8e-31)
                 t_1
                 (if (<= y 1.75e+20) (+ (/ x (* (- y z) t)) 1.0) t_1))))
            double code(double x, double y, double z, double t) {
            	double t_1 = 1.0 - (x / (y * y));
            	double tmp;
            	if (y <= -5.8e-31) {
            		tmp = t_1;
            	} else if (y <= 1.75e+20) {
            		tmp = (x / ((y - z) * t)) + 1.0;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: t_1
                real(8) :: tmp
                t_1 = 1.0d0 - (x / (y * y))
                if (y <= (-5.8d-31)) then
                    tmp = t_1
                else if (y <= 1.75d+20) then
                    tmp = (x / ((y - z) * t)) + 1.0d0
                else
                    tmp = t_1
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double t_1 = 1.0 - (x / (y * y));
            	double tmp;
            	if (y <= -5.8e-31) {
            		tmp = t_1;
            	} else if (y <= 1.75e+20) {
            		tmp = (x / ((y - z) * t)) + 1.0;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	t_1 = 1.0 - (x / (y * y))
            	tmp = 0
            	if y <= -5.8e-31:
            		tmp = t_1
            	elif y <= 1.75e+20:
            		tmp = (x / ((y - z) * t)) + 1.0
            	else:
            		tmp = t_1
            	return tmp
            
            function code(x, y, z, t)
            	t_1 = Float64(1.0 - Float64(x / Float64(y * y)))
            	tmp = 0.0
            	if (y <= -5.8e-31)
            		tmp = t_1;
            	elseif (y <= 1.75e+20)
            		tmp = Float64(Float64(x / Float64(Float64(y - z) * t)) + 1.0);
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	t_1 = 1.0 - (x / (y * y));
            	tmp = 0.0;
            	if (y <= -5.8e-31)
            		tmp = t_1;
            	elseif (y <= 1.75e+20)
            		tmp = (x / ((y - z) * t)) + 1.0;
            	else
            		tmp = t_1;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e-31], t$95$1, If[LessEqual[y, 1.75e+20], N[(N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := 1 - \frac{x}{y \cdot y}\\
            \mathbf{if}\;y \leq -5.8 \cdot 10^{-31}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;y \leq 1.75 \cdot 10^{+20}:\\
            \;\;\;\;\frac{x}{\left(y - z\right) \cdot t} + 1\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -5.8000000000000001e-31 or 1.75e20 < y

              1. Initial program 99.9%

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

                \[\leadsto 1 - \frac{x}{\color{blue}{{y}^{2}}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto 1 - \frac{x}{\color{blue}{y \cdot y}} \]
                2. lower-*.f6492.0

                  \[\leadsto 1 - \frac{x}{\color{blue}{y \cdot y}} \]
              5. Applied rewrites92.0%

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

              if -5.8000000000000001e-31 < y < 1.75e20

              1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

            Alternative 7: 86.9% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 - \frac{x}{y \cdot y}\\ \mathbf{if}\;y \leq -7.4 \cdot 10^{-31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{z \cdot \left(y - t\right)} + 1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (- 1.0 (/ x (* y y)))))
               (if (<= y -7.4e-31)
                 t_1
                 (if (<= y 1.75e+20) (+ (/ x (* z (- y t))) 1.0) t_1))))
            double code(double x, double y, double z, double t) {
            	double t_1 = 1.0 - (x / (y * y));
            	double tmp;
            	if (y <= -7.4e-31) {
            		tmp = t_1;
            	} else if (y <= 1.75e+20) {
            		tmp = (x / (z * (y - t))) + 1.0;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: t_1
                real(8) :: tmp
                t_1 = 1.0d0 - (x / (y * y))
                if (y <= (-7.4d-31)) then
                    tmp = t_1
                else if (y <= 1.75d+20) then
                    tmp = (x / (z * (y - t))) + 1.0d0
                else
                    tmp = t_1
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double t_1 = 1.0 - (x / (y * y));
            	double tmp;
            	if (y <= -7.4e-31) {
            		tmp = t_1;
            	} else if (y <= 1.75e+20) {
            		tmp = (x / (z * (y - t))) + 1.0;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	t_1 = 1.0 - (x / (y * y))
            	tmp = 0
            	if y <= -7.4e-31:
            		tmp = t_1
            	elif y <= 1.75e+20:
            		tmp = (x / (z * (y - t))) + 1.0
            	else:
            		tmp = t_1
            	return tmp
            
            function code(x, y, z, t)
            	t_1 = Float64(1.0 - Float64(x / Float64(y * y)))
            	tmp = 0.0
            	if (y <= -7.4e-31)
            		tmp = t_1;
            	elseif (y <= 1.75e+20)
            		tmp = Float64(Float64(x / Float64(z * Float64(y - t))) + 1.0);
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	t_1 = 1.0 - (x / (y * y));
            	tmp = 0.0;
            	if (y <= -7.4e-31)
            		tmp = t_1;
            	elseif (y <= 1.75e+20)
            		tmp = (x / (z * (y - t))) + 1.0;
            	else
            		tmp = t_1;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.4e-31], t$95$1, If[LessEqual[y, 1.75e+20], N[(N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := 1 - \frac{x}{y \cdot y}\\
            \mathbf{if}\;y \leq -7.4 \cdot 10^{-31}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;y \leq 1.75 \cdot 10^{+20}:\\
            \;\;\;\;\frac{x}{z \cdot \left(y - t\right)} + 1\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -7.3999999999999996e-31 or 1.75e20 < y

              1. Initial program 99.9%

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

                \[\leadsto 1 - \frac{x}{\color{blue}{{y}^{2}}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto 1 - \frac{x}{\color{blue}{y \cdot y}} \]
                2. lower-*.f6492.0

                  \[\leadsto 1 - \frac{x}{\color{blue}{y \cdot y}} \]
              5. Applied rewrites92.0%

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

              if -7.3999999999999996e-31 < y < 1.75e20

              1. Initial program 99.1%

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

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

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

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

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

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

                  \[\leadsto \frac{x}{\color{blue}{\left(y - t\right) \cdot z}} + 1 \]
                6. lower--.f6488.9

                  \[\leadsto \frac{x}{\color{blue}{\left(y - t\right)} \cdot z} + 1 \]
              5. Applied rewrites88.9%

                \[\leadsto \color{blue}{\frac{x}{\left(y - t\right) \cdot z} + 1} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification90.5%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{-31}:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{z \cdot \left(y - t\right)} + 1\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \end{array} \]
            5. Add Preprocessing

            Alternative 8: 81.3% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 - \frac{x}{y \cdot y}\\ \mathbf{if}\;y \leq -3.05 \cdot 10^{-31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+19}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (- 1.0 (/ x (* y y)))))
               (if (<= y -3.05e-31) t_1 (if (<= y 1.1e+19) (- 1.0 (/ x (* z t))) t_1))))
            double code(double x, double y, double z, double t) {
            	double t_1 = 1.0 - (x / (y * y));
            	double tmp;
            	if (y <= -3.05e-31) {
            		tmp = t_1;
            	} else if (y <= 1.1e+19) {
            		tmp = 1.0 - (x / (z * t));
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: t_1
                real(8) :: tmp
                t_1 = 1.0d0 - (x / (y * y))
                if (y <= (-3.05d-31)) then
                    tmp = t_1
                else if (y <= 1.1d+19) then
                    tmp = 1.0d0 - (x / (z * t))
                else
                    tmp = t_1
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double t_1 = 1.0 - (x / (y * y));
            	double tmp;
            	if (y <= -3.05e-31) {
            		tmp = t_1;
            	} else if (y <= 1.1e+19) {
            		tmp = 1.0 - (x / (z * t));
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	t_1 = 1.0 - (x / (y * y))
            	tmp = 0
            	if y <= -3.05e-31:
            		tmp = t_1
            	elif y <= 1.1e+19:
            		tmp = 1.0 - (x / (z * t))
            	else:
            		tmp = t_1
            	return tmp
            
            function code(x, y, z, t)
            	t_1 = Float64(1.0 - Float64(x / Float64(y * y)))
            	tmp = 0.0
            	if (y <= -3.05e-31)
            		tmp = t_1;
            	elseif (y <= 1.1e+19)
            		tmp = Float64(1.0 - Float64(x / Float64(z * t)));
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	t_1 = 1.0 - (x / (y * y));
            	tmp = 0.0;
            	if (y <= -3.05e-31)
            		tmp = t_1;
            	elseif (y <= 1.1e+19)
            		tmp = 1.0 - (x / (z * t));
            	else
            		tmp = t_1;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.05e-31], t$95$1, If[LessEqual[y, 1.1e+19], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := 1 - \frac{x}{y \cdot y}\\
            \mathbf{if}\;y \leq -3.05 \cdot 10^{-31}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;y \leq 1.1 \cdot 10^{+19}:\\
            \;\;\;\;1 - \frac{x}{z \cdot t}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -3.0499999999999999e-31 or 1.1e19 < y

              1. Initial program 99.9%

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

                \[\leadsto 1 - \frac{x}{\color{blue}{{y}^{2}}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto 1 - \frac{x}{\color{blue}{y \cdot y}} \]
                2. lower-*.f6492.0

                  \[\leadsto 1 - \frac{x}{\color{blue}{y \cdot y}} \]
              5. Applied rewrites92.0%

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

              if -3.0499999999999999e-31 < y < 1.1e19

              1. Initial program 99.1%

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

                \[\leadsto 1 - \frac{x}{\color{blue}{t \cdot z}} \]
              4. Step-by-step derivation
                1. lower-*.f6474.2

                  \[\leadsto 1 - \frac{x}{\color{blue}{t \cdot z}} \]
              5. Applied rewrites74.2%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.05 \cdot 10^{-31}:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+19}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \end{array} \]
            5. Add Preprocessing

            Alternative 9: 99.0% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ 1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)} \end{array} \]
            (FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- z y) (- t y)))))
            double code(double x, double y, double z, double t) {
            	return 1.0 - (x / ((z - y) * (t - y)));
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                code = 1.0d0 - (x / ((z - y) * (t - y)))
            end function
            
            public static double code(double x, double y, double z, double t) {
            	return 1.0 - (x / ((z - y) * (t - y)));
            }
            
            def code(x, y, z, t):
            	return 1.0 - (x / ((z - y) * (t - y)))
            
            function code(x, y, z, t)
            	return Float64(1.0 - Float64(x / Float64(Float64(z - y) * Float64(t - y))))
            end
            
            function tmp = code(x, y, z, t)
            	tmp = 1.0 - (x / ((z - y) * (t - y)));
            end
            
            code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(z - y), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)}
            \end{array}
            
            Derivation
            1. Initial program 99.5%

              \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
            2. Add Preprocessing
            3. Final simplification99.5%

              \[\leadsto 1 - \frac{x}{\left(z - y\right) \cdot \left(t - y\right)} \]
            4. Add Preprocessing

            Alternative 10: 74.3% accurate, 26.0× speedup?

            \[\begin{array}{l} \\ 1 \end{array} \]
            (FPCore (x y z t) :precision binary64 1.0)
            double code(double x, double y, double z, double t) {
            	return 1.0;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                code = 1.0d0
            end function
            
            public static double code(double x, double y, double z, double t) {
            	return 1.0;
            }
            
            def code(x, y, z, t):
            	return 1.0
            
            function code(x, y, z, t)
            	return 1.0
            end
            
            function tmp = code(x, y, z, t)
            	tmp = 1.0;
            end
            
            code[x_, y_, z_, t_] := 1.0
            
            \begin{array}{l}
            
            \\
            1
            \end{array}
            
            Derivation
            1. Initial program 99.5%

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

              \[\leadsto \color{blue}{1} \]
            4. Step-by-step derivation
              1. Applied rewrites70.5%

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

              Reproduce

              ?
              herbie shell --seed 2024298 
              (FPCore (x y z t)
                :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
                :precision binary64
                (- 1.0 (/ x (* (- y z) (- y t)))))