
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y x) t)))
(if (<= t -3.6e+197)
(- (fma (* t_1 z) -1.0 y) (- (* a t_1)))
(if (<= t 6.8e+165)
(fma (- y x) (/ (- z t) (- a t)) x)
(+ y (* -1.0 (* x (/ (- a z) t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - x) / t;
double tmp;
if (t <= -3.6e+197) {
tmp = fma((t_1 * z), -1.0, y) - -(a * t_1);
} else if (t <= 6.8e+165) {
tmp = fma((y - x), ((z - t) / (a - t)), x);
} else {
tmp = y + (-1.0 * (x * ((a - z) / t)));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - x) / t) tmp = 0.0 if (t <= -3.6e+197) tmp = Float64(fma(Float64(t_1 * z), -1.0, y) - Float64(-Float64(a * t_1))); elseif (t <= 6.8e+165) tmp = fma(Float64(y - x), Float64(Float64(z - t) / Float64(a - t)), x); else tmp = Float64(y + Float64(-1.0 * Float64(x * Float64(Float64(a - z) / t)))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -3.6e+197], N[(N[(N[(t$95$1 * z), $MachinePrecision] * -1.0 + y), $MachinePrecision] - (-N[(a * t$95$1), $MachinePrecision])), $MachinePrecision], If[LessEqual[t, 6.8e+165], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(y + N[(-1.0 * N[(x * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - x}{t}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{+197}:\\
\;\;\;\;\mathsf{fma}\left(t\_1 \cdot z, -1, y\right) - \left(-a \cdot t\_1\right)\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+165}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + -1 \cdot \left(x \cdot \frac{a - z}{t}\right)\\
\end{array}
\end{array}
if t < -3.59999999999999982e197Initial program 28.5%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6466.4
Applied rewrites66.4%
Taylor expanded in t around inf
associate-*r/N/A
+-commutativeN/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6484.4
Applied rewrites84.4%
if -3.59999999999999982e197 < t < 6.80000000000000022e165Initial program 78.0%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6489.1
Applied rewrites89.1%
if 6.80000000000000022e165 < t Initial program 30.2%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6465.2
Applied rewrites65.2%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f6450.2
Applied rewrites50.2%
Taylor expanded in t around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6466.0
Applied rewrites66.0%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6481.0
Applied rewrites81.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y x) (/ (- z t) (- a t)) x))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -1e-263) t_1 (if (<= t_2 0.0) (+ y (/ (* x (- z a)) t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), ((z - t) / (a - t)), x);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -1e-263) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = y + ((x * (z - a)) / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), Float64(Float64(z - t) / Float64(a - t)), x) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -1e-263) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(y + Float64(Float64(x * Float64(z - a)) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-263], t$95$1, If[LessEqual[t$95$2, 0.0], N[(y + N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-263}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;y + \frac{x \cdot \left(z - a\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1e-263 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 72.8%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6490.3
Applied rewrites90.3%
if -1e-263 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 9.2%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f649.2
Applied rewrites9.2%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f649.0
Applied rewrites9.0%
Taylor expanded in t around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6495.1
Applied rewrites95.1%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6495.1
Applied rewrites95.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.25e+54)
(fma y (/ (- z t) a) x)
(if (<= a -2.65e-130)
(* y (/ (- z t) (- a t)))
(if (<= a 1.1e-19) (- y (/ (* z (- y x)) t)) (fma (- y x) (/ z a) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.25e+54) {
tmp = fma(y, ((z - t) / a), x);
} else if (a <= -2.65e-130) {
tmp = y * ((z - t) / (a - t));
} else if (a <= 1.1e-19) {
tmp = y - ((z * (y - x)) / t);
} else {
tmp = fma((y - x), (z / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.25e+54) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (a <= -2.65e-130) tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); elseif (a <= 1.1e-19) tmp = Float64(y - Float64(Float64(z * Float64(y - x)) / t)); else tmp = fma(Float64(y - x), Float64(z / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.25e+54], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, -2.65e-130], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.1e-19], N[(y - N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.25 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;a \leq -2.65 \cdot 10^{-130}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-19}:\\
\;\;\;\;y - \frac{z \cdot \left(y - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.24999999999999992e54Initial program 68.5%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6493.0
Applied rewrites93.0%
Taylor expanded in x around 0
Applied rewrites83.3%
Taylor expanded in t around 0
Applied rewrites72.7%
if -2.24999999999999992e54 < a < -2.6500000000000002e-130Initial program 70.8%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6481.9
Applied rewrites81.9%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f6476.7
Applied rewrites76.7%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6460.4
Applied rewrites60.4%
if -2.6500000000000002e-130 < a < 1.0999999999999999e-19Initial program 66.7%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6476.9
Applied rewrites76.9%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f6466.7
Applied rewrites66.7%
Taylor expanded in t around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6477.8
Applied rewrites77.8%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6474.4
Applied rewrites74.4%
if 1.0999999999999999e-19 < a Initial program 68.2%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6489.7
Applied rewrites89.7%
Taylor expanded in t around 0
lower-/.f6465.6
Applied rewrites65.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.4e+40)
(fma y (/ (- z t) a) x)
(if (<= a 4.45e-169)
(* (- y x) (/ z (- a t)))
(if (<= a 6.6) (/ (* (- z t) y) (- a t)) (fma (- y x) (/ z a) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.4e+40) {
tmp = fma(y, ((z - t) / a), x);
} else if (a <= 4.45e-169) {
tmp = (y - x) * (z / (a - t));
} else if (a <= 6.6) {
tmp = ((z - t) * y) / (a - t);
} else {
tmp = fma((y - x), (z / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.4e+40) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (a <= 4.45e-169) tmp = Float64(Float64(y - x) * Float64(z / Float64(a - t))); elseif (a <= 6.6) tmp = Float64(Float64(Float64(z - t) * y) / Float64(a - t)); else tmp = fma(Float64(y - x), Float64(z / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.4e+40], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 4.45e-169], N[(N[(y - x), $MachinePrecision] * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.6], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;a \leq 4.45 \cdot 10^{-169}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{a - t}\\
\mathbf{elif}\;a \leq 6.6:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.4e40Initial program 69.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6492.8
Applied rewrites92.8%
Taylor expanded in x around 0
Applied rewrites82.6%
Taylor expanded in t around 0
Applied rewrites71.4%
if -2.4e40 < a < 4.44999999999999971e-169Initial program 67.2%
Taylor expanded in z around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6453.7
Applied rewrites53.7%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6456.6
Applied rewrites56.6%
if 4.44999999999999971e-169 < a < 6.5999999999999996Initial program 70.4%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6449.2
Applied rewrites49.2%
if 6.5999999999999996 < a Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6489.9
Applied rewrites89.9%
Taylor expanded in t around 0
lower-/.f6466.7
Applied rewrites66.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ y (* -1.0 (* x (/ (- a z) t))))))
(if (<= t -3e+199)
t_1
(if (<= t 6.8e+165) (fma (- y x) (/ (- z t) (- a t)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y + (-1.0 * (x * ((a - z) / t)));
double tmp;
if (t <= -3e+199) {
tmp = t_1;
} else if (t <= 6.8e+165) {
tmp = fma((y - x), ((z - t) / (a - t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y + Float64(-1.0 * Float64(x * Float64(Float64(a - z) / t)))) tmp = 0.0 if (t <= -3e+199) tmp = t_1; elseif (t <= 6.8e+165) tmp = fma(Float64(y - x), Float64(Float64(z - t) / Float64(a - t)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y + N[(-1.0 * N[(x * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3e+199], t$95$1, If[LessEqual[t, 6.8e+165], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + -1 \cdot \left(x \cdot \frac{a - z}{t}\right)\\
\mathbf{if}\;t \leq -3 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+165}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.0000000000000001e199 or 6.80000000000000022e165 < t Initial program 29.5%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6465.6
Applied rewrites65.6%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f6448.8
Applied rewrites48.8%
Taylor expanded in t around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6465.1
Applied rewrites65.1%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6481.6
Applied rewrites81.6%
if -3.0000000000000001e199 < t < 6.80000000000000022e165Initial program 77.8%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6489.1
Applied rewrites89.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.6e+196)
y
(if (<= t -1.7e-188)
(fma y (/ (- z t) a) x)
(if (<= t 4e+116) (fma z (/ (- y x) a) x) y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.6e+196) {
tmp = y;
} else if (t <= -1.7e-188) {
tmp = fma(y, ((z - t) / a), x);
} else if (t <= 4e+116) {
tmp = fma(z, ((y - x) / a), x);
} else {
tmp = y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.6e+196) tmp = y; elseif (t <= -1.7e-188) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (t <= 4e+116) tmp = fma(z, Float64(Float64(y - x) / a), x); else tmp = y; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.6e+196], y, If[LessEqual[t, -1.7e-188], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 4e+116], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], y]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+196}:\\
\;\;\;\;y\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-188}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if t < -1.59999999999999996e196 or 4.00000000000000006e116 < t Initial program 32.3%
Taylor expanded in t around inf
Applied rewrites55.9%
if -1.59999999999999996e196 < t < -1.70000000000000014e-188Initial program 70.7%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6485.7
Applied rewrites85.7%
Taylor expanded in x around 0
Applied rewrites68.1%
Taylor expanded in t around 0
Applied rewrites46.3%
if -1.70000000000000014e-188 < t < 4.00000000000000006e116Initial program 86.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- z t) (- a t)) x)))
(if (<= a -3.9e-126)
t_1
(if (<= a 5.6e-59) (+ y (* z (/ (- x y) t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((z - t) / (a - t)), x);
double tmp;
if (a <= -3.9e-126) {
tmp = t_1;
} else if (a <= 5.6e-59) {
tmp = y + (z * ((x - y) / t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(z - t) / Float64(a - t)), x) tmp = 0.0 if (a <= -3.9e-126) tmp = t_1; elseif (a <= 5.6e-59) tmp = Float64(y + Float64(z * Float64(Float64(x - y) / t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.9e-126], t$95$1, If[LessEqual[a, 5.6e-59], N[(y + N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)\\
\mathbf{if}\;a \leq -3.9 \cdot 10^{-126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{-59}:\\
\;\;\;\;y + z \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.8999999999999998e-126 or 5.59999999999999961e-59 < a Initial program 69.2%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6488.6
Applied rewrites88.6%
Taylor expanded in x around 0
Applied rewrites75.3%
if -3.8999999999999998e-126 < a < 5.59999999999999961e-59Initial program 66.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6476.4
Applied rewrites76.4%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f6465.8
Applied rewrites65.8%
Taylor expanded in t around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6479.4
Applied rewrites79.4%
Taylor expanded in z around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6479.3
Applied rewrites79.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y x) (/ (- z t) a) x)))
(if (<= a -500000000000.0)
t_1
(if (<= a 4.2e-10) (+ y (* z (/ (- x y) t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), ((z - t) / a), x);
double tmp;
if (a <= -500000000000.0) {
tmp = t_1;
} else if (a <= 4.2e-10) {
tmp = y + (z * ((x - y) / t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), Float64(Float64(z - t) / a), x) tmp = 0.0 if (a <= -500000000000.0) tmp = t_1; elseif (a <= 4.2e-10) tmp = Float64(y + Float64(z * Float64(Float64(x - y) / t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -500000000000.0], t$95$1, If[LessEqual[a, 4.2e-10], N[(y + N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{if}\;a \leq -500000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-10}:\\
\;\;\;\;y + z \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5e11 or 4.2e-10 < a Initial program 68.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6474.6
Applied rewrites74.6%
if -5e11 < a < 4.2e-10Initial program 67.7%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6477.8
Applied rewrites77.8%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f6468.8
Applied rewrites68.8%
Taylor expanded in t around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6473.9
Applied rewrites73.9%
Taylor expanded in z around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6473.6
Applied rewrites73.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.5e+80) (fma y (/ (- z t) a) x) (if (<= a 4.2e-10) (+ y (* z (/ (- x y) t))) (fma (- y x) (/ z a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.5e+80) {
tmp = fma(y, ((z - t) / a), x);
} else if (a <= 4.2e-10) {
tmp = y + (z * ((x - y) / t));
} else {
tmp = fma((y - x), (z / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.5e+80) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (a <= 4.2e-10) tmp = Float64(y + Float64(z * Float64(Float64(x - y) / t))); else tmp = fma(Float64(y - x), Float64(z / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.5e+80], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 4.2e-10], N[(y + N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+80}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-10}:\\
\;\;\;\;y + z \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.4999999999999998e80Initial program 67.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6493.1
Applied rewrites93.1%
Taylor expanded in x around 0
Applied rewrites83.9%
Taylor expanded in t around 0
Applied rewrites73.9%
if -2.4999999999999998e80 < a < 4.2e-10Initial program 68.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6478.9
Applied rewrites78.9%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f6470.4
Applied rewrites70.4%
Taylor expanded in t around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6470.2
Applied rewrites70.2%
Taylor expanded in z around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6470.2
Applied rewrites70.2%
if 4.2e-10 < a Initial program 68.0%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6489.9
Applied rewrites89.9%
Taylor expanded in t around 0
lower-/.f6466.4
Applied rewrites66.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.5e+40) (fma y (/ (- z t) a) x) (if (<= a 1.1e-19) (- y (/ (* z (- y x)) t)) (fma (- y x) (/ z a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.5e+40) {
tmp = fma(y, ((z - t) / a), x);
} else if (a <= 1.1e-19) {
tmp = y - ((z * (y - x)) / t);
} else {
tmp = fma((y - x), (z / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.5e+40) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (a <= 1.1e-19) tmp = Float64(y - Float64(Float64(z * Float64(y - x)) / t)); else tmp = fma(Float64(y - x), Float64(z / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.5e+40], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.1e-19], N[(y - N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-19}:\\
\;\;\;\;y - \frac{z \cdot \left(y - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\end{array}
\end{array}
if a < -8.49999999999999996e40Initial program 69.0%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6492.8
Applied rewrites92.8%
Taylor expanded in x around 0
Applied rewrites82.6%
Taylor expanded in t around 0
Applied rewrites71.4%
if -8.49999999999999996e40 < a < 1.0999999999999999e-19Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6478.1
Applied rewrites78.1%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
inv-powN/A
lower-pow.f64N/A
lift--.f6469.1
Applied rewrites69.1%
Taylor expanded in t around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6472.7
Applied rewrites72.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6469.0
Applied rewrites69.0%
if 1.0999999999999999e-19 < a Initial program 68.2%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6489.7
Applied rewrites89.7%
Taylor expanded in t around 0
lower-/.f6465.6
Applied rewrites65.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.4e+40) (fma y (/ (- z t) a) x) (if (<= a 4.1e-10) (* (- y x) (/ z (- a t))) (fma (- y x) (/ z a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.4e+40) {
tmp = fma(y, ((z - t) / a), x);
} else if (a <= 4.1e-10) {
tmp = (y - x) * (z / (a - t));
} else {
tmp = fma((y - x), (z / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.4e+40) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (a <= 4.1e-10) tmp = Float64(Float64(y - x) * Float64(z / Float64(a - t))); else tmp = fma(Float64(y - x), Float64(z / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.4e+40], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 4.1e-10], N[(N[(y - x), $MachinePrecision] * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{-10}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.4e40Initial program 69.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6492.8
Applied rewrites92.8%
Taylor expanded in x around 0
Applied rewrites82.6%
Taylor expanded in t around 0
Applied rewrites71.4%
if -2.4e40 < a < 4.0999999999999998e-10Initial program 67.7%
Taylor expanded in z around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6452.6
Applied rewrites52.6%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6455.5
Applied rewrites55.5%
if 4.0999999999999998e-10 < a Initial program 68.0%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6489.9
Applied rewrites89.9%
Taylor expanded in t around 0
lower-/.f6466.4
Applied rewrites66.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.5e+66) y (if (<= t 1.8e+117) (fma (- y x) (/ z a) x) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e+66) {
tmp = y;
} else if (t <= 1.8e+117) {
tmp = fma((y - x), (z / a), x);
} else {
tmp = y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5e+66) tmp = y; elseif (t <= 1.8e+117) tmp = fma(Float64(y - x), Float64(z / a), x); else tmp = y; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5e+66], y, If[LessEqual[t, 1.8e+117], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+66}:\\
\;\;\;\;y\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if t < -2.49999999999999996e66 or 1.80000000000000006e117 < t Initial program 37.6%
Taylor expanded in t around inf
Applied rewrites49.8%
if -2.49999999999999996e66 < t < 1.80000000000000006e117Initial program 85.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6492.3
Applied rewrites92.3%
Taylor expanded in t around 0
lower-/.f6466.1
Applied rewrites66.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.5e+66) y (if (<= t 4e+116) (fma z (/ (- y x) a) x) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e+66) {
tmp = y;
} else if (t <= 4e+116) {
tmp = fma(z, ((y - x) / a), x);
} else {
tmp = y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5e+66) tmp = y; elseif (t <= 4e+116) tmp = fma(z, Float64(Float64(y - x) / a), x); else tmp = y; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5e+66], y, If[LessEqual[t, 4e+116], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+66}:\\
\;\;\;\;y\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if t < -2.49999999999999996e66 or 4.00000000000000006e116 < t Initial program 37.6%
Taylor expanded in t around inf
Applied rewrites49.8%
if -2.49999999999999996e66 < t < 4.00000000000000006e116Initial program 85.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6464.5
Applied rewrites64.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.8e+38) y (if (<= t 1.18e+117) (fma y (/ z a) x) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.8e+38) {
tmp = y;
} else if (t <= 1.18e+117) {
tmp = fma(y, (z / a), x);
} else {
tmp = y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.8e+38) tmp = y; elseif (t <= 1.18e+117) tmp = fma(y, Float64(z / a), x); else tmp = y; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.8e+38], y, If[LessEqual[t, 1.18e+117], N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+38}:\\
\;\;\;\;y\\
\mathbf{elif}\;t \leq 1.18 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if t < -4.80000000000000035e38 or 1.18e117 < t Initial program 39.5%
Taylor expanded in t around inf
Applied rewrites48.0%
if -4.80000000000000035e38 < t < 1.18e117Initial program 85.7%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6492.5
Applied rewrites92.5%
Taylor expanded in x around 0
Applied rewrites72.7%
Taylor expanded in t around 0
Applied rewrites60.0%
Taylor expanded in z around inf
Applied rewrites55.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.7e+53) x (if (<= a 2.45e-8) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.7e+53) {
tmp = x;
} else if (a <= 2.45e-8) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-6.7d+53)) then
tmp = x
else if (a <= 2.45d-8) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.7e+53) {
tmp = x;
} else if (a <= 2.45e-8) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.7e+53: tmp = x elif a <= 2.45e-8: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.7e+53) tmp = x; elseif (a <= 2.45e-8) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.7e+53) tmp = x; elseif (a <= 2.45e-8) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.7e+53], x, If[LessEqual[a, 2.45e-8], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.7 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.45 \cdot 10^{-8}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.6999999999999997e53 or 2.4500000000000001e-8 < a Initial program 68.2%
Taylor expanded in a around inf
Applied rewrites44.0%
if -6.6999999999999997e53 < a < 2.4500000000000001e-8Initial program 68.0%
Taylor expanded in t around inf
Applied rewrites33.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 68.1%
Taylor expanded in a around inf
Applied rewrites24.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
(if (< a -1.6153062845442575e-142)
t_1
(if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - x) / 1.0d0) * ((z - t) / (a - t)))
if (a < (-1.6153062845442575d-142)) then
tmp = t_1
else if (a < 3.774403170083174d-182) then
tmp = y - ((z / t) * (y - x))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))) tmp = 0 if a < -1.6153062845442575e-142: tmp = t_1 elif a < 3.774403170083174e-182: tmp = y - ((z / t) * (y - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) / 1.0) * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))); tmp = 0.0; if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = y - ((z / t) * (y - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[a, -1.6153062845442575e-142], t$95$1, If[Less[a, 3.774403170083174e-182], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2025105
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< a -646122513817703/4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 1887201585041587/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))