
(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 20 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 (fma (/ (- t z) (- t a)) (- y x) x))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -1e-127)
t_1
(if (<= t_2 0.0)
(/ (* -1.0 (* t (+ y (* -1.0 (/ (fma a x (* z (- y x))) t))))) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / (t - a)), (y - x), x);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -1e-127) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = (-1.0 * (t * (y + (-1.0 * (fma(a, x, (z * (y - x))) / t))))) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / Float64(t - a)), Float64(y - x), x) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -1e-127) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(Float64(-1.0 * Float64(t * Float64(y + Float64(-1.0 * Float64(fma(a, x, Float64(z * Float64(y - x))) / t))))) / Float64(a - t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $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-127], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(-1.0 * N[(t * N[(y + N[(-1.0 * N[(N[(a * x + N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{t - a}, y - x, 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^{-127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{-1 \cdot \left(t \cdot \left(y + -1 \cdot \frac{\mathsf{fma}\left(a, x, z \cdot \left(y - x\right)\right)}{t}\right)\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1e-127 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
if -1e-127 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 68.5%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f6463.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.1
Applied rewrites63.1%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6465.9
Applied rewrites65.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t z) (- t a)) (- y x) x))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -2e-223)
t_1
(if (<= t_2 0.0)
(+ y (* -1.0 (/ (- (* z (- y x)) (* a (- y x))) t)))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / (t - a)), (y - x), x);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -2e-223) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = y + (-1.0 * (((z * (y - x)) - (a * (y - x))) / t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / Float64(t - a)), Float64(y - x), x) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -2e-223) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(y + Float64(-1.0 * Float64(Float64(Float64(z * Float64(y - x)) - Float64(a * Float64(y - x))) / t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $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, -2e-223], t$95$1, If[LessEqual[t$95$2, 0.0], N[(y + N[(-1.0 * N[(N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{t - a}, y - x, x\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-223}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;y + -1 \cdot \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.9999999999999999e-223 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
if -1.9999999999999999e-223 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 68.5%
Taylor expanded in t around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6445.9
Applied rewrites45.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t z) (- t a)) (- y x) x))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -5e-273)
t_1
(if (<= t_2 0.0) (/ (fma a x (* z (- y x))) (- a t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / (t - a)), (y - x), x);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -5e-273) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(a, x, (z * (y - x))) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / Float64(t - a)), Float64(y - x), x) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -5e-273) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(fma(a, x, Float64(z * Float64(y - x))) / Float64(a - t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $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, -5e-273], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(a * x + N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{t - a}, y - x, x\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-273}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, x, z \cdot \left(y - x\right)\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -4.99999999999999965e-273 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
if -4.99999999999999965e-273 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 68.5%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f6463.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.1
Applied rewrites63.1%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6456.8
Applied rewrites56.8%
(FPCore (x y z t a) :precision binary64 (fma (/ (- t z) (- t a)) (- y x) x))
double code(double x, double y, double z, double t, double a) {
return fma(((t - z) / (t - a)), (y - x), x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(t - z) / Float64(t - a)), Float64(y - x), x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{t - z}{t - a}, y - x, x\right)
\end{array}
Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 6.8e+261) (fma (- z t) (/ (- x y) (- t a)) x) (* (/ (- z t) (- a t)) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 6.8e+261) {
tmp = fma((z - t), ((x - y) / (t - a)), x);
} else {
tmp = ((z - t) / (a - t)) * y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 6.8e+261) tmp = fma(Float64(z - t), Float64(Float64(x - y) / Float64(t - a)), x); else tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 6.8e+261], N[(N[(z - t), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.8 \cdot 10^{+261}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{x - y}{t - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\end{array}
\end{array}
if t < 6.8e261Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6479.7
Applied rewrites79.7%
if 6.8e261 < t Initial program 68.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.0
Applied rewrites39.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6450.9
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6450.9
Applied rewrites50.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- z t) a) (- y x) x)))
(if (<= a -3.2e+22)
t_1
(if (<= a 3.05e-152)
(fma (/ (- t z) t) (- y x) x)
(if (<= a 3.05e-21) (+ x (/ (* z (- y x)) (- a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((z - t) / a), (y - x), x);
double tmp;
if (a <= -3.2e+22) {
tmp = t_1;
} else if (a <= 3.05e-152) {
tmp = fma(((t - z) / t), (y - x), x);
} else if (a <= 3.05e-21) {
tmp = x + ((z * (y - x)) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(z - t) / a), Float64(y - x), x) tmp = 0.0 if (a <= -3.2e+22) tmp = t_1; elseif (a <= 3.05e-152) tmp = fma(Float64(Float64(t - z) / t), Float64(y - x), x); elseif (a <= 3.05e-21) tmp = Float64(x + Float64(Float64(z * Float64(y - x)) / Float64(a - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.2e+22], t$95$1, If[LessEqual[a, 3.05e-152], N[(N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 3.05e-21], N[(x + N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z - t}{a}, y - x, x\right)\\
\mathbf{if}\;a \leq -3.2 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.05 \cdot 10^{-152}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{t}, y - x, x\right)\\
\mathbf{elif}\;a \leq 3.05 \cdot 10^{-21}:\\
\;\;\;\;x + \frac{z \cdot \left(y - x\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.2e22 or 3.05000000000000007e-21 < a Initial program 68.5%
Taylor expanded in t around 0
Applied rewrites47.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6453.8
Applied rewrites53.8%
if -3.2e22 < a < 3.04999999999999991e-152Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6438.4
Applied rewrites38.4%
if 3.04999999999999991e-152 < a < 3.05000000000000007e-21Initial program 68.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6455.8
Applied rewrites55.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- z t) a) (- y x) x)))
(if (<= a -3.2e+22)
t_1
(if (<= a 2.3e-151) (fma (/ (- t z) t) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((z - t) / a), (y - x), x);
double tmp;
if (a <= -3.2e+22) {
tmp = t_1;
} else if (a <= 2.3e-151) {
tmp = fma(((t - z) / t), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(z - t) / a), Float64(y - x), x) tmp = 0.0 if (a <= -3.2e+22) tmp = t_1; elseif (a <= 2.3e-151) tmp = fma(Float64(Float64(t - z) / t), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.2e+22], t$95$1, If[LessEqual[a, 2.3e-151], N[(N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z - t}{a}, y - x, x\right)\\
\mathbf{if}\;a \leq -3.2 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-151}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.2e22 or 2.29999999999999996e-151 < a Initial program 68.5%
Taylor expanded in t around 0
Applied rewrites47.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6453.8
Applied rewrites53.8%
if -3.2e22 < a < 2.29999999999999996e-151Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6438.4
Applied rewrites38.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.3e+22) (fma (/ (- z t) a) y x) (if (<= a 2.3e-151) (fma (/ (- t z) t) (- y x) x) (fma (/ z a) (- y x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.3e+22) {
tmp = fma(((z - t) / a), y, x);
} else if (a <= 2.3e-151) {
tmp = fma(((t - z) / t), (y - x), x);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.3e+22) tmp = fma(Float64(Float64(z - t) / a), y, x); elseif (a <= 2.3e-151) tmp = fma(Float64(Float64(t - z) / t), Float64(y - x), x); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.3e+22], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[a, 2.3e-151], N[(N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.3 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-151}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if a < -3.2999999999999998e22Initial program 68.5%
Taylor expanded in t around 0
Applied rewrites47.3%
Taylor expanded in x around 0
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6445.9
Applied rewrites45.9%
if -3.2999999999999998e22 < a < 2.29999999999999996e-151Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6438.4
Applied rewrites38.4%
if 2.29999999999999996e-151 < a Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around 0
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.8e+25) (fma (/ (- z t) a) y x) (if (<= a 3.8e-151) (* (/ (- z t) (- a t)) y) (fma (/ z a) (- y x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e+25) {
tmp = fma(((z - t) / a), y, x);
} else if (a <= 3.8e-151) {
tmp = ((z - t) / (a - t)) * y;
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.8e+25) tmp = fma(Float64(Float64(z - t) / a), y, x); elseif (a <= 3.8e-151) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e+25], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[a, 3.8e-151], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{-151}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if a < -1.80000000000000008e25Initial program 68.5%
Taylor expanded in t around 0
Applied rewrites47.3%
Taylor expanded in x around 0
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6445.9
Applied rewrites45.9%
if -1.80000000000000008e25 < a < 3.7999999999999997e-151Initial program 68.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.0
Applied rewrites39.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6450.9
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6450.9
Applied rewrites50.9%
if 3.7999999999999997e-151 < a Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around 0
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -18000000000000.0) (fma (/ (- z t) a) y x) (if (<= a 6e-55) (* (/ z (- t a)) (- x y)) (fma (/ z a) (- y x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -18000000000000.0) {
tmp = fma(((z - t) / a), y, x);
} else if (a <= 6e-55) {
tmp = (z / (t - a)) * (x - y);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -18000000000000.0) tmp = fma(Float64(Float64(z - t) / a), y, x); elseif (a <= 6e-55) tmp = Float64(Float64(z / Float64(t - a)) * Float64(x - y)); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -18000000000000.0], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[a, 6e-55], N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -18000000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-55}:\\
\;\;\;\;\frac{z}{t - a} \cdot \left(x - y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if a < -1.8e13Initial program 68.5%
Taylor expanded in t around 0
Applied rewrites47.3%
Taylor expanded in x around 0
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6445.9
Applied rewrites45.9%
if -1.8e13 < a < 6.00000000000000033e-55Initial program 68.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.9
Applied rewrites41.9%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
div-flipN/A
lower-/.f64N/A
lower-/.f6442.2
Applied rewrites42.2%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
frac-2negN/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6443.8
Applied rewrites43.8%
if 6.00000000000000033e-55 < a Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around 0
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.9e+22) (fma (/ (- z t) a) y x) (if (<= a 5.8e-158) (fma 1.0 (- y x) x) (fma (/ z a) (- y x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.9e+22) {
tmp = fma(((z - t) / a), y, x);
} else if (a <= 5.8e-158) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.9e+22) tmp = fma(Float64(Float64(z - t) / a), y, x); elseif (a <= 5.8e-158) tmp = fma(1.0, Float64(y - x), x); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.9e+22], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[a, 5.8e-158], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-158}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if a < -1.9000000000000002e22Initial program 68.5%
Taylor expanded in t around 0
Applied rewrites47.3%
Taylor expanded in x around 0
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6445.9
Applied rewrites45.9%
if -1.9000000000000002e22 < a < 5.79999999999999961e-158Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites18.8%
if 5.79999999999999961e-158 < a Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around 0
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.9e+22) (fma (- z t) (/ y a) x) (if (<= a 5.8e-158) (fma 1.0 (- y x) x) (fma (/ z a) (- y x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.9e+22) {
tmp = fma((z - t), (y / a), x);
} else if (a <= 5.8e-158) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.9e+22) tmp = fma(Float64(z - t), Float64(y / a), x); elseif (a <= 5.8e-158) tmp = fma(1.0, Float64(y - x), x); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.9e+22], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 5.8e-158], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-158}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if a < -1.9000000000000002e22Initial program 68.5%
Taylor expanded in t around 0
Applied rewrites47.3%
Taylor expanded in x around 0
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6444.6
Applied rewrites44.6%
if -1.9000000000000002e22 < a < 5.79999999999999961e-158Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites18.8%
if 5.79999999999999961e-158 < a Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around 0
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ z a) (- y x) x))) (if (<= a -1.9e+22) t_1 (if (<= a 5.8e-158) (fma 1.0 (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((z / a), (y - x), x);
double tmp;
if (a <= -1.9e+22) {
tmp = t_1;
} else if (a <= 5.8e-158) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(z / a), Float64(y - x), x) tmp = 0.0 if (a <= -1.9e+22) tmp = t_1; elseif (a <= 5.8e-158) tmp = fma(1.0, Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.9e+22], t$95$1, If[LessEqual[a, 5.8e-158], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{if}\;a \leq -1.9 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-158}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.9000000000000002e22 or 5.79999999999999961e-158 < a Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around 0
lower-/.f6449.4
Applied rewrites49.4%
if -1.9000000000000002e22 < a < 5.79999999999999961e-158Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites18.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ (- y x) a))))
(if (<= z -4.5e+63)
t_1
(if (<= z -5.8e-306)
(/ (* a x) (- a t))
(if (<= z 4.5e+39) (fma 1.0 (- y x) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * ((y - x) / a);
double tmp;
if (z <= -4.5e+63) {
tmp = t_1;
} else if (z <= -5.8e-306) {
tmp = (a * x) / (a - t);
} else if (z <= 4.5e+39) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(z * Float64(Float64(y - x) / a)) tmp = 0.0 if (z <= -4.5e+63) tmp = t_1; elseif (z <= -5.8e-306) tmp = Float64(Float64(a * x) / Float64(a - t)); elseif (z <= 4.5e+39) tmp = fma(1.0, Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+63], t$95$1, If[LessEqual[z, -5.8e-306], N[(N[(a * x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e+39], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y - x}{a}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-306}:\\
\;\;\;\;\frac{a \cdot x}{a - t}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.50000000000000017e63 or 4.49999999999999996e39 < z Initial program 68.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.9
Applied rewrites41.9%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6425.9
Applied rewrites25.9%
if -4.50000000000000017e63 < z < -5.7999999999999998e-306Initial program 68.5%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f6463.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.1
Applied rewrites63.1%
Taylor expanded in a around inf
lower-*.f6421.6
Applied rewrites21.6%
if -5.7999999999999998e-306 < z < 4.49999999999999996e39Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites18.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 1.0 (- y x) x)))
(if (<= t -3.2e+127)
t_1
(if (<= t -2.7e-143)
(* z (/ y (- a t)))
(if (<= t 7.5e+32) (* z (/ (- y x) a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(1.0, (y - x), x);
double tmp;
if (t <= -3.2e+127) {
tmp = t_1;
} else if (t <= -2.7e-143) {
tmp = z * (y / (a - t));
} else if (t <= 7.5e+32) {
tmp = z * ((y - x) / a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(1.0, Float64(y - x), x) tmp = 0.0 if (t <= -3.2e+127) tmp = t_1; elseif (t <= -2.7e-143) tmp = Float64(z * Float64(y / Float64(a - t))); elseif (t <= 7.5e+32) tmp = Float64(z * Float64(Float64(y - x) / a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -3.2e+127], t$95$1, If[LessEqual[t, -2.7e-143], N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+32], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.7 \cdot 10^{-143}:\\
\;\;\;\;z \cdot \frac{y}{a - t}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+32}:\\
\;\;\;\;z \cdot \frac{y - x}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.19999999999999976e127 or 7.49999999999999959e32 < t Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites18.8%
if -3.19999999999999976e127 < t < -2.70000000000000009e-143Initial program 68.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.9
Applied rewrites41.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6423.4
Applied rewrites23.4%
if -2.70000000000000009e-143 < t < 7.49999999999999959e32Initial program 68.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.9
Applied rewrites41.9%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6425.9
Applied rewrites25.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* z (/ y (- a t))))) (if (<= z -4.3e+63) t_1 (if (<= z 3.45e+28) (fma 1.0 (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (a - t));
double tmp;
if (z <= -4.3e+63) {
tmp = t_1;
} else if (z <= 3.45e+28) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(a - t))) tmp = 0.0 if (z <= -4.3e+63) tmp = t_1; elseif (z <= 3.45e+28) tmp = fma(1.0, Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+63], t$95$1, If[LessEqual[z, 3.45e+28], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{a - t}\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.45 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.3e63 or 3.45e28 < z Initial program 68.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.9
Applied rewrites41.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6423.4
Applied rewrites23.4%
if -4.3e63 < z < 3.45e28Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites18.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma 1.0 (- y x) x))) (if (<= t -2.1e-98) t_1 (if (<= t 5.2e+30) (/ (* z (- y x)) a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(1.0, (y - x), x);
double tmp;
if (t <= -2.1e-98) {
tmp = t_1;
} else if (t <= 5.2e+30) {
tmp = (z * (y - x)) / a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(1.0, Float64(y - x), x) tmp = 0.0 if (t <= -2.1e-98) tmp = t_1; elseif (t <= 5.2e+30) tmp = Float64(Float64(z * Float64(y - x)) / a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -2.1e-98], t$95$1, If[LessEqual[t, 5.2e+30], N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{z \cdot \left(y - x\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.09999999999999992e-98 or 5.19999999999999977e30 < t Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites18.8%
if -2.09999999999999992e-98 < t < 5.19999999999999977e30Initial program 68.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.9
Applied rewrites41.9%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
div-flipN/A
lower-/.f64N/A
lower-/.f6442.2
Applied rewrites42.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.2
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6442.4
Applied rewrites42.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6423.9
Applied rewrites23.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ z a) y))) (if (<= z -6.8e+63) t_1 (if (<= z 3.2e+44) (fma 1.0 (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z / a) * y;
double tmp;
if (z <= -6.8e+63) {
tmp = t_1;
} else if (z <= 3.2e+44) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z / a) * y) tmp = 0.0 if (z <= -6.8e+63) tmp = t_1; elseif (z <= 3.2e+44) tmp = fma(1.0, Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[z, -6.8e+63], t$95$1, If[LessEqual[z, 3.2e+44], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{a} \cdot y\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+44}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.7999999999999997e63 or 3.20000000000000004e44 < z Initial program 68.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.0
Applied rewrites39.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6416.8
Applied rewrites16.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6419.2
Applied rewrites19.2%
if -6.7999999999999997e63 < z < 3.20000000000000004e44Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6483.9
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites18.8%
(FPCore (x y z t a) :precision binary64 (* (/ z a) y))
double code(double x, double y, double z, double t, double a) {
return (z / a) * y;
}
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 = (z / a) * y
end function
public static double code(double x, double y, double z, double t, double a) {
return (z / a) * y;
}
def code(x, y, z, t, a): return (z / a) * y
function code(x, y, z, t, a) return Float64(Float64(z / a) * y) end
function tmp = code(x, y, z, t, a) tmp = (z / a) * y; end
code[x_, y_, z_, t_, a_] := N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}
\\
\frac{z}{a} \cdot y
\end{array}
Initial program 68.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.0
Applied rewrites39.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6416.8
Applied rewrites16.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6419.2
Applied rewrites19.2%
(FPCore (x y z t a) :precision binary64 (* z (/ y a)))
double code(double x, double y, double z, double t, double a) {
return z * (y / a);
}
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 = z * (y / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return z * (y / a);
}
def code(x, y, z, t, a): return z * (y / a)
function code(x, y, z, t, a) return Float64(z * Float64(y / a)) end
function tmp = code(x, y, z, t, a) tmp = z * (y / a); end
code[x_, y_, z_, t_, a_] := N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \frac{y}{a}
\end{array}
Initial program 68.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.0
Applied rewrites39.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6416.8
Applied rewrites16.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.2
Applied rewrites18.2%
herbie shell --seed 2025156
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y x) (- z t)) (- a t))))