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

Percentage Accurate: 99.0% → 99.0%
Time: 7.2s
Alternatives: 8
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 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: 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: 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}
Derivation
  1. Initial program 99.5%

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

Alternative 2: 89.7% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;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)))) < -2 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 x around inf

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{\mathsf{neg}\left(\left(y - z\right)\right)}} \]
      9. sub-negN/A

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z} - y} \]
      16. lower--.f6489.8

        \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z - y}} \]
    5. Applied rewrites89.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{y - t}}{z - y}} \]
    6. Taylor expanded in z around inf

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

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

      if -2 < (-.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.2%

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

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

      Alternative 3: 85.8% accurate, 0.3× speedup?

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{\mathsf{neg}\left(\left(y - z\right)\right)}} \]
          9. sub-negN/A

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

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

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

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

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

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

            \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z} - y} \]
          16. lower--.f6489.8

            \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z - y}} \]
        5. Applied rewrites89.8%

          \[\leadsto \color{blue}{\frac{\frac{x}{y - t}}{z - y}} \]
        6. Taylor expanded in y around 0

          \[\leadsto -1 \cdot \color{blue}{\frac{x}{t \cdot z}} \]
        7. Step-by-step derivation
          1. Applied rewrites40.7%

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

          if -2 < (-.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.2%

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

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

          Alternative 4: 89.4% accurate, 0.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{\left(y - t\right) \cdot z}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\left(z - y\right) \cdot t}\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (/ x (* (- y z) (- y t)))))
             (if (<= t_1 -1e+18)
               (/ x (* (- y t) z))
               (if (<= t_1 5e-6) 1.0 (/ (- x) (* (- z y) t))))))
          double code(double x, double y, double z, double t) {
          	double t_1 = x / ((y - z) * (y - t));
          	double tmp;
          	if (t_1 <= -1e+18) {
          		tmp = x / ((y - t) * z);
          	} else if (t_1 <= 5e-6) {
          		tmp = 1.0;
          	} else {
          		tmp = -x / ((z - y) * t);
          	}
          	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 = x / ((y - z) * (y - t))
              if (t_1 <= (-1d+18)) then
                  tmp = x / ((y - t) * z)
              else if (t_1 <= 5d-6) then
                  tmp = 1.0d0
              else
                  tmp = -x / ((z - y) * t)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double t_1 = x / ((y - z) * (y - t));
          	double tmp;
          	if (t_1 <= -1e+18) {
          		tmp = x / ((y - t) * z);
          	} else if (t_1 <= 5e-6) {
          		tmp = 1.0;
          	} else {
          		tmp = -x / ((z - y) * t);
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	t_1 = x / ((y - z) * (y - t))
          	tmp = 0
          	if t_1 <= -1e+18:
          		tmp = x / ((y - t) * z)
          	elif t_1 <= 5e-6:
          		tmp = 1.0
          	else:
          		tmp = -x / ((z - y) * t)
          	return tmp
          
          function code(x, y, z, t)
          	t_1 = Float64(x / Float64(Float64(y - z) * Float64(y - t)))
          	tmp = 0.0
          	if (t_1 <= -1e+18)
          		tmp = Float64(x / Float64(Float64(y - t) * z));
          	elseif (t_1 <= 5e-6)
          		tmp = 1.0;
          	else
          		tmp = Float64(Float64(-x) / Float64(Float64(z - y) * t));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	t_1 = x / ((y - z) * (y - t));
          	tmp = 0.0;
          	if (t_1 <= -1e+18)
          		tmp = x / ((y - t) * z);
          	elseif (t_1 <= 5e-6)
          		tmp = 1.0;
          	else
          		tmp = -x / ((z - y) * t);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+18], N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-6], 1.0, N[((-x) / N[(N[(z - y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
          \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+18}:\\
          \;\;\;\;\frac{x}{\left(y - t\right) \cdot z}\\
          
          \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\
          \;\;\;\;1\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{-x}{\left(z - y\right) \cdot t}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < -1e18

            1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{\mathsf{neg}\left(\left(y - z\right)\right)}} \]
              9. sub-negN/A

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z} - y} \]
              16. lower--.f6491.9

                \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z - y}} \]
            5. Applied rewrites91.9%

              \[\leadsto \color{blue}{\frac{\frac{x}{y - t}}{z - y}} \]
            6. Taylor expanded in z around inf

              \[\leadsto \frac{x}{\color{blue}{z \cdot \left(y - t\right)}} \]
            7. Step-by-step derivation
              1. Applied rewrites53.9%

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

              if -1e18 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < 5.00000000000000041e-6

              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.2%

                  \[\leadsto \color{blue}{1} \]

                if 5.00000000000000041e-6 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))

                1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{\mathsf{neg}\left(\left(y - z\right)\right)}} \]
                  9. sub-negN/A

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

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

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

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

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

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

                    \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z} - y} \]
                  16. lower--.f6487.8

                    \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z - y}} \]
                5. Applied rewrites87.8%

                  \[\leadsto \color{blue}{\frac{\frac{x}{y - t}}{z - y}} \]
                6. Taylor expanded in t around inf

                  \[\leadsto -1 \cdot \color{blue}{\frac{x}{t \cdot \left(z - y\right)}} \]
                7. Step-by-step derivation
                  1. Applied rewrites55.1%

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

                Alternative 5: 81.9% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{\mathsf{neg}\left(\left(y - z\right)\right)}} \]
                    9. sub-negN/A

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

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

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

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

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

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

                      \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z} - y} \]
                    16. lower--.f6491.6

                      \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z - y}} \]
                  5. Applied rewrites91.6%

                    \[\leadsto \color{blue}{\frac{\frac{x}{y - t}}{z - y}} \]
                  6. Taylor expanded in z around inf

                    \[\leadsto \frac{x}{\color{blue}{z \cdot \left(y - t\right)}} \]
                  7. Step-by-step derivation
                    1. Applied rewrites54.1%

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

                      \[\leadsto \frac{x}{y \cdot z} \]
                    3. Step-by-step derivation
                      1. Applied rewrites26.2%

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

                      if -5e21 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < 10

                      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 rewrites97.7%

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

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

                      Alternative 6: 82.1% accurate, 0.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+41}:\\ \;\;\;\;\frac{-x}{y \cdot y}\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \end{array} \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (let* ((t_1 (/ x (* (- y z) (- y t)))))
                         (if (<= t_1 -5e+41)
                           (/ (- x) (* y y))
                           (if (<= t_1 10.0) 1.0 (/ x (* z y))))))
                      double code(double x, double y, double z, double t) {
                      	double t_1 = x / ((y - z) * (y - t));
                      	double tmp;
                      	if (t_1 <= -5e+41) {
                      		tmp = -x / (y * y);
                      	} else if (t_1 <= 10.0) {
                      		tmp = 1.0;
                      	} else {
                      		tmp = x / (z * y);
                      	}
                      	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 = x / ((y - z) * (y - t))
                          if (t_1 <= (-5d+41)) then
                              tmp = -x / (y * y)
                          else if (t_1 <= 10.0d0) then
                              tmp = 1.0d0
                          else
                              tmp = x / (z * y)
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t) {
                      	double t_1 = x / ((y - z) * (y - t));
                      	double tmp;
                      	if (t_1 <= -5e+41) {
                      		tmp = -x / (y * y);
                      	} else if (t_1 <= 10.0) {
                      		tmp = 1.0;
                      	} else {
                      		tmp = x / (z * y);
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t):
                      	t_1 = x / ((y - z) * (y - t))
                      	tmp = 0
                      	if t_1 <= -5e+41:
                      		tmp = -x / (y * y)
                      	elif t_1 <= 10.0:
                      		tmp = 1.0
                      	else:
                      		tmp = x / (z * y)
                      	return tmp
                      
                      function code(x, y, z, t)
                      	t_1 = Float64(x / Float64(Float64(y - z) * Float64(y - t)))
                      	tmp = 0.0
                      	if (t_1 <= -5e+41)
                      		tmp = Float64(Float64(-x) / Float64(y * y));
                      	elseif (t_1 <= 10.0)
                      		tmp = 1.0;
                      	else
                      		tmp = Float64(x / Float64(z * y));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t)
                      	t_1 = x / ((y - z) * (y - t));
                      	tmp = 0.0;
                      	if (t_1 <= -5e+41)
                      		tmp = -x / (y * y);
                      	elseif (t_1 <= 10.0)
                      		tmp = 1.0;
                      	else
                      		tmp = x / (z * y);
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+41], N[((-x) / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 10.0], 1.0, N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
                      \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+41}:\\
                      \;\;\;\;\frac{-x}{y \cdot y}\\
                      
                      \mathbf{elif}\;t\_1 \leq 10:\\
                      \;\;\;\;1\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{x}{z \cdot y}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < -5.00000000000000022e41

                        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{\mathsf{neg}\left(\left(y - z\right)\right)}} \]
                          9. sub-negN/A

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

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

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

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

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

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

                            \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z} - y} \]
                          16. lower--.f6491.1

                            \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z - y}} \]
                        5. Applied rewrites91.1%

                          \[\leadsto \color{blue}{\frac{\frac{x}{y - t}}{z - y}} \]
                        6. Taylor expanded in y around inf

                          \[\leadsto -1 \cdot \color{blue}{\frac{x}{{y}^{2}}} \]
                        7. Step-by-step derivation
                          1. Applied rewrites50.1%

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

                          if -5.00000000000000022e41 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < 10

                          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.8%

                              \[\leadsto \color{blue}{1} \]

                            if 10 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))

                            1. Initial program 97.0%

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{\mathsf{neg}\left(\left(y - z\right)\right)}} \]
                              9. sub-negN/A

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

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

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

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

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

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

                                \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z} - y} \]
                              16. lower--.f6491.6

                                \[\leadsto \frac{\frac{x}{y - t}}{\color{blue}{z - y}} \]
                            5. Applied rewrites91.6%

                              \[\leadsto \color{blue}{\frac{\frac{x}{y - t}}{z - y}} \]
                            6. Taylor expanded in z around inf

                              \[\leadsto \frac{x}{\color{blue}{z \cdot \left(y - t\right)}} \]
                            7. Step-by-step derivation
                              1. Applied rewrites55.6%

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

                                \[\leadsto \frac{x}{y \cdot z} \]
                              3. Step-by-step derivation
                                1. Applied rewrites27.0%

                                  \[\leadsto \frac{x}{z \cdot y} \]
                              4. Recombined 3 regimes into one program.
                              5. Add Preprocessing

                              Alternative 7: 81.7% accurate, 0.7× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 2.1 \cdot 10^{-242}:\\ \;\;\;\;1 - \frac{x}{\left(t - y\right) \cdot z}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-61}:\\ \;\;\;\;1 - \frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{x}{\left(z - y\right) \cdot t}\\ \end{array} \end{array} \]
                              (FPCore (x y z t)
                               :precision binary64
                               (if (<= t 2.1e-242)
                                 (- 1.0 (/ x (* (- t y) z)))
                                 (if (<= t 2.4e-61) (- 1.0 (/ x (* y y))) (- 1.0 (/ x (* (- z y) t))))))
                              double code(double x, double y, double z, double t) {
                              	double tmp;
                              	if (t <= 2.1e-242) {
                              		tmp = 1.0 - (x / ((t - y) * z));
                              	} else if (t <= 2.4e-61) {
                              		tmp = 1.0 - (x / (y * y));
                              	} else {
                              		tmp = 1.0 - (x / ((z - y) * t));
                              	}
                              	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) :: tmp
                                  if (t <= 2.1d-242) then
                                      tmp = 1.0d0 - (x / ((t - y) * z))
                                  else if (t <= 2.4d-61) then
                                      tmp = 1.0d0 - (x / (y * y))
                                  else
                                      tmp = 1.0d0 - (x / ((z - y) * t))
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double x, double y, double z, double t) {
                              	double tmp;
                              	if (t <= 2.1e-242) {
                              		tmp = 1.0 - (x / ((t - y) * z));
                              	} else if (t <= 2.4e-61) {
                              		tmp = 1.0 - (x / (y * y));
                              	} else {
                              		tmp = 1.0 - (x / ((z - y) * t));
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z, t):
                              	tmp = 0
                              	if t <= 2.1e-242:
                              		tmp = 1.0 - (x / ((t - y) * z))
                              	elif t <= 2.4e-61:
                              		tmp = 1.0 - (x / (y * y))
                              	else:
                              		tmp = 1.0 - (x / ((z - y) * t))
                              	return tmp
                              
                              function code(x, y, z, t)
                              	tmp = 0.0
                              	if (t <= 2.1e-242)
                              		tmp = Float64(1.0 - Float64(x / Float64(Float64(t - y) * z)));
                              	elseif (t <= 2.4e-61)
                              		tmp = Float64(1.0 - Float64(x / Float64(y * y)));
                              	else
                              		tmp = Float64(1.0 - Float64(x / Float64(Float64(z - y) * t)));
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, y, z, t)
                              	tmp = 0.0;
                              	if (t <= 2.1e-242)
                              		tmp = 1.0 - (x / ((t - y) * z));
                              	elseif (t <= 2.4e-61)
                              		tmp = 1.0 - (x / (y * y));
                              	else
                              		tmp = 1.0 - (x / ((z - y) * t));
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_, z_, t_] := If[LessEqual[t, 2.1e-242], N[(1.0 - N[(x / N[(N[(t - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-61], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(N[(z - y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;t \leq 2.1 \cdot 10^{-242}:\\
                              \;\;\;\;1 - \frac{x}{\left(t - y\right) \cdot z}\\
                              
                              \mathbf{elif}\;t \leq 2.4 \cdot 10^{-61}:\\
                              \;\;\;\;1 - \frac{x}{y \cdot y}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;1 - \frac{x}{\left(z - y\right) \cdot t}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if t < 2.10000000000000019e-242

                                1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if 2.10000000000000019e-242 < t < 2.4000000000000001e-61

                                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-*.f6472.2

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

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

                                if 2.4000000000000001e-61 < t

                                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 8: 75.9% 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 rewrites71.8%

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

                                Reproduce

                                ?
                                herbie shell --seed 2024318 
                                (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)))))