Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D

Percentage Accurate: 93.0% → 97.6%
Time: 4.2s
Alternatives: 6
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - x\right)}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
def code(x, y, z, t):
	return x + ((y * (z - x)) / t)
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * Float64(z - x)) / t))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * (z - x)) / t);
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 6 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: 93.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - x\right)}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
def code(x, y, z, t):
	return x + ((y * (z - x)) / t)
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * Float64(z - x)) / t))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * (z - x)) / t);
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 97.6% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{t}{y}}{z - x}}} + x \]
    7. associate-/r/N/A

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

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

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

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

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

Alternative 2: 85.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{if}\;x \leq -4.4 \cdot 10^{+61}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-36}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y}{t}, x\right)\\ \mathbf{elif}\;x \leq 1.08 \cdot 10^{+64}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y t)))))
   (if (<= x -4.4e+61)
     t_1
     (if (<= x 3.9e-36)
       (fma z (/ y t) x)
       (if (<= x 1.08e+64) (* (- z x) (/ y t)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double tmp;
	if (x <= -4.4e+61) {
		tmp = t_1;
	} else if (x <= 3.9e-36) {
		tmp = fma(z, (y / t), x);
	} else if (x <= 1.08e+64) {
		tmp = (z - x) * (y / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - Float64(y / t)))
	tmp = 0.0
	if (x <= -4.4e+61)
		tmp = t_1;
	elseif (x <= 3.9e-36)
		tmp = fma(z, Float64(y / t), x);
	elseif (x <= 1.08e+64)
		tmp = Float64(Float64(z - x) * Float64(y / t));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e+61], t$95$1, If[LessEqual[x, 3.9e-36], N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[x, 1.08e+64], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 1.08 \cdot 10^{+64}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.4000000000000001e61 or 1.08000000000000007e64 < x

    1. Initial program 93.0%

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{t}{y}}{z - x}}} + x \]
      7. associate-/r/N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z - x}}} - \left(\mathsf{neg}\left(x\right)\right) \]
      7. add-flip-revN/A

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z - x}} + x} \]
      8. +-commutativeN/A

        \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
      9. add-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\left(x - z\right)} \cdot y}{t} \]
      24. lower--.f6493.0

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

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

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

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

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

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

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

    if -4.4000000000000001e61 < x < 3.9000000000000001e-36

    1. Initial program 93.0%

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

      \[\leadsto x + \frac{y \cdot \color{blue}{z}}{t} \]
    3. Step-by-step derivation
      1. Applied rewrites73.1%

        \[\leadsto x + \frac{y \cdot \color{blue}{z}}{t} \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{x + \frac{y \cdot z}{t}} \]
        2. +-commutativeN/A

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

          \[\leadsto \color{blue}{\frac{y \cdot z}{t}} + x \]
        4. lift-*.f64N/A

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

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

          \[\leadsto \color{blue}{z \cdot \frac{y}{t}} + x \]
        7. lift-/.f64N/A

          \[\leadsto z \cdot \color{blue}{\frac{y}{t}} + x \]
        8. lower-fma.f6476.6

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)} \]

      if 3.9000000000000001e-36 < x < 1.08000000000000007e64

      1. Initial program 93.0%

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

        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{y \cdot z}{\color{blue}{t}} \]
        2. lower-*.f6438.2

          \[\leadsto \frac{y \cdot z}{t} \]
      4. Applied rewrites38.2%

        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{y \cdot z}{\color{blue}{t}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{y \cdot z}{t} \]
        3. *-commutativeN/A

          \[\leadsto \frac{z \cdot y}{t} \]
        4. associate-/l*N/A

          \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
        5. lift-/.f64N/A

          \[\leadsto z \cdot \frac{y}{\color{blue}{t}} \]
        6. lower-*.f6441.2

          \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
      6. Applied rewrites41.2%

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

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

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

          \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
        3. lower--.f6458.9

          \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
      9. Applied rewrites58.9%

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

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

          \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
        3. *-commutativeN/A

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

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

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

          \[\leadsto \left(z - x\right) \cdot \frac{y}{\color{blue}{t}} \]
      11. Applied rewrites61.4%

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

    Alternative 3: 85.2% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{elif}\;t\_1 \leq 10^{+291}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y}{t}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z - x}{t} \cdot y\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (+ x (/ (* y (- z x)) t))))
       (if (<= t_1 (- INFINITY))
         (* (- z x) (/ y t))
         (if (<= t_1 1e+291) (fma z (/ y t) x) (* (/ (- z x) t) y)))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x + ((y * (z - x)) / t);
    	double tmp;
    	if (t_1 <= -((double) INFINITY)) {
    		tmp = (z - x) * (y / t);
    	} else if (t_1 <= 1e+291) {
    		tmp = fma(z, (y / t), x);
    	} else {
    		tmp = ((z - x) / t) * y;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(x + Float64(Float64(y * Float64(z - x)) / t))
    	tmp = 0.0
    	if (t_1 <= Float64(-Inf))
    		tmp = Float64(Float64(z - x) * Float64(y / t));
    	elseif (t_1 <= 1e+291)
    		tmp = fma(z, Float64(y / t), x);
    	else
    		tmp = Float64(Float64(Float64(z - x) / t) * y);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+291], N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\
    \mathbf{if}\;t\_1 \leq -\infty:\\
    \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
    
    \mathbf{elif}\;t\_1 \leq 10^{+291}:\\
    \;\;\;\;\mathsf{fma}\left(z, \frac{y}{t}, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{z - x}{t} \cdot y\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0

      1. Initial program 93.0%

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

        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{y \cdot z}{\color{blue}{t}} \]
        2. lower-*.f6438.2

          \[\leadsto \frac{y \cdot z}{t} \]
      4. Applied rewrites38.2%

        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{y \cdot z}{\color{blue}{t}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{y \cdot z}{t} \]
        3. *-commutativeN/A

          \[\leadsto \frac{z \cdot y}{t} \]
        4. associate-/l*N/A

          \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
        5. lift-/.f64N/A

          \[\leadsto z \cdot \frac{y}{\color{blue}{t}} \]
        6. lower-*.f6441.2

          \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
      6. Applied rewrites41.2%

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

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

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

          \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
        3. lower--.f6458.9

          \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
      9. Applied rewrites58.9%

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

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

          \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
        3. *-commutativeN/A

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

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

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

          \[\leadsto \left(z - x\right) \cdot \frac{y}{\color{blue}{t}} \]
      11. Applied rewrites61.4%

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

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

      1. Initial program 93.0%

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

        \[\leadsto x + \frac{y \cdot \color{blue}{z}}{t} \]
      3. Step-by-step derivation
        1. Applied rewrites73.1%

          \[\leadsto x + \frac{y \cdot \color{blue}{z}}{t} \]
        2. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{x + \frac{y \cdot z}{t}} \]
          2. +-commutativeN/A

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

            \[\leadsto \color{blue}{\frac{y \cdot z}{t}} + x \]
          4. lift-*.f64N/A

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

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

            \[\leadsto \color{blue}{z \cdot \frac{y}{t}} + x \]
          7. lift-/.f64N/A

            \[\leadsto z \cdot \color{blue}{\frac{y}{t}} + x \]
          8. lower-fma.f6476.6

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)} \]

        if 9.9999999999999996e290 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t))

        1. Initial program 93.0%

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

          \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{y \cdot z}{\color{blue}{t}} \]
          2. lower-*.f6438.2

            \[\leadsto \frac{y \cdot z}{t} \]
        4. Applied rewrites38.2%

          \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
        5. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \frac{y \cdot z}{\color{blue}{t}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{y \cdot z}{t} \]
          3. *-commutativeN/A

            \[\leadsto \frac{z \cdot y}{t} \]
          4. associate-/l*N/A

            \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
          5. lift-/.f64N/A

            \[\leadsto z \cdot \frac{y}{\color{blue}{t}} \]
          6. lower-*.f6441.2

            \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
        6. Applied rewrites41.2%

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

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

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

            \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
          3. lower--.f6458.9

            \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
        9. Applied rewrites58.9%

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

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

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

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

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

            \[\leadsto \frac{z - x}{t} \cdot \color{blue}{y} \]
          6. lower-/.f6458.8

            \[\leadsto \frac{z - x}{t} \cdot y \]
        11. Applied rewrites58.8%

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

      Alternative 4: 85.0% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z - x\right) \cdot \frac{y}{t}\\ t_2 := x + \frac{y \cdot \left(z - x\right)}{t}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+291}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y}{t}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (- z x) (/ y t))) (t_2 (+ x (/ (* y (- z x)) t))))
         (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 1e+291) (fma z (/ y t) x) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = (z - x) * (y / t);
      	double t_2 = x + ((y * (z - x)) / t);
      	double tmp;
      	if (t_2 <= -((double) INFINITY)) {
      		tmp = t_1;
      	} else if (t_2 <= 1e+291) {
      		tmp = fma(z, (y / t), x);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = Float64(Float64(z - x) * Float64(y / t))
      	t_2 = Float64(x + Float64(Float64(y * Float64(z - x)) / t))
      	tmp = 0.0
      	if (t_2 <= Float64(-Inf))
      		tmp = t_1;
      	elseif (t_2 <= 1e+291)
      		tmp = fma(z, Float64(y / t), x);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 1e+291], N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(z - x\right) \cdot \frac{y}{t}\\
      t_2 := x + \frac{y \cdot \left(z - x\right)}{t}\\
      \mathbf{if}\;t\_2 \leq -\infty:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t\_2 \leq 10^{+291}:\\
      \;\;\;\;\mathsf{fma}\left(z, \frac{y}{t}, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0 or 9.9999999999999996e290 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t))

        1. Initial program 93.0%

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

          \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{y \cdot z}{\color{blue}{t}} \]
          2. lower-*.f6438.2

            \[\leadsto \frac{y \cdot z}{t} \]
        4. Applied rewrites38.2%

          \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
        5. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \frac{y \cdot z}{\color{blue}{t}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{y \cdot z}{t} \]
          3. *-commutativeN/A

            \[\leadsto \frac{z \cdot y}{t} \]
          4. associate-/l*N/A

            \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
          5. lift-/.f64N/A

            \[\leadsto z \cdot \frac{y}{\color{blue}{t}} \]
          6. lower-*.f6441.2

            \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
        6. Applied rewrites41.2%

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

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

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

            \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
          3. lower--.f6458.9

            \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
        9. Applied rewrites58.9%

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

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

            \[\leadsto \frac{y \cdot \left(z - x\right)}{t} \]
          3. *-commutativeN/A

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

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

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

            \[\leadsto \left(z - x\right) \cdot \frac{y}{\color{blue}{t}} \]
        11. Applied rewrites61.4%

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

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

        1. Initial program 93.0%

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

          \[\leadsto x + \frac{y \cdot \color{blue}{z}}{t} \]
        3. Step-by-step derivation
          1. Applied rewrites73.1%

            \[\leadsto x + \frac{y \cdot \color{blue}{z}}{t} \]
          2. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \color{blue}{x + \frac{y \cdot z}{t}} \]
            2. +-commutativeN/A

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

              \[\leadsto \color{blue}{\frac{y \cdot z}{t}} + x \]
            4. lift-*.f64N/A

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

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

              \[\leadsto \color{blue}{z \cdot \frac{y}{t}} + x \]
            7. lift-/.f64N/A

              \[\leadsto z \cdot \color{blue}{\frac{y}{t}} + x \]
            8. lower-fma.f6476.6

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

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

        Alternative 5: 76.6% accurate, 1.4× speedup?

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

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

          \[\leadsto x + \frac{y \cdot \color{blue}{z}}{t} \]
        3. Step-by-step derivation
          1. Applied rewrites73.1%

            \[\leadsto x + \frac{y \cdot \color{blue}{z}}{t} \]
          2. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \color{blue}{x + \frac{y \cdot z}{t}} \]
            2. +-commutativeN/A

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

              \[\leadsto \color{blue}{\frac{y \cdot z}{t}} + x \]
            4. lift-*.f64N/A

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

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

              \[\leadsto \color{blue}{z \cdot \frac{y}{t}} + x \]
            7. lift-/.f64N/A

              \[\leadsto z \cdot \color{blue}{\frac{y}{t}} + x \]
            8. lower-fma.f6476.6

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

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

          Alternative 6: 41.2% accurate, 1.7× speedup?

          \[\begin{array}{l} \\ z \cdot \frac{y}{t} \end{array} \]
          (FPCore (x y z t) :precision binary64 (* z (/ y t)))
          double code(double x, double y, double z, double t) {
          	return z * (y / t);
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              code = z * (y / t)
          end function
          
          public static double code(double x, double y, double z, double t) {
          	return z * (y / t);
          }
          
          def code(x, y, z, t):
          	return z * (y / t)
          
          function code(x, y, z, t)
          	return Float64(z * Float64(y / t))
          end
          
          function tmp = code(x, y, z, t)
          	tmp = z * (y / t);
          end
          
          code[x_, y_, z_, t_] := N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          z \cdot \frac{y}{t}
          \end{array}
          
          Derivation
          1. Initial program 93.0%

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

            \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{y \cdot z}{\color{blue}{t}} \]
            2. lower-*.f6438.2

              \[\leadsto \frac{y \cdot z}{t} \]
          4. Applied rewrites38.2%

            \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
          5. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \frac{y \cdot z}{\color{blue}{t}} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{y \cdot z}{t} \]
            3. *-commutativeN/A

              \[\leadsto \frac{z \cdot y}{t} \]
            4. associate-/l*N/A

              \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
            5. lift-/.f64N/A

              \[\leadsto z \cdot \frac{y}{\color{blue}{t}} \]
            6. lower-*.f6441.2

              \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
          6. Applied rewrites41.2%

            \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
          7. Add Preprocessing

          Reproduce

          ?
          herbie shell --seed 2025142 
          (FPCore (x y z t)
            :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
            :precision binary64
            (+ x (/ (* y (- z x)) t)))