
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (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) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (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) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (- (+ 1.0 (/ t (- a t))) (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((1.0 + (t / (a - t))) - (z / (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 * ((1.0d0 + (t / (a - t))) - (z / (a - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((1.0 + (t / (a - t))) - (z / (a - t))));
}
def code(x, y, z, t, a): return x + (y * ((1.0 + (t / (a - t))) - (z / (a - t))))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(1.0 + Float64(t / Float64(a - t))) - Float64(z / Float64(a - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((1.0 + (t / (a - t))) - (z / (a - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(1.0 + N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \left(\left(1 + \frac{t}{a - t}\right) - \frac{z}{a - t}\right)
\end{array}
Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (* -1.0 (/ (- a z) t)) y x))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t))))
(t_3 (- (+ x y) (/ (* y z) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -4e-212)
t_3
(if (<= t_2 0.0)
t_1
(if (<= t_2 1e+297) t_3 (+ x (* y (/ -1.0 (/ (- a t) z))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((-1.0 * ((a - z) / t)), y, x);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double t_3 = (x + y) - ((y * z) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -4e-212) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 1e+297) {
tmp = t_3;
} else {
tmp = x + (y * (-1.0 / ((a - t) / z)));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-1.0 * Float64(Float64(a - z) / t)), y, x) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) t_3 = Float64(Float64(x + y) - Float64(Float64(y * z) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -4e-212) tmp = t_3; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 1e+297) tmp = t_3; else tmp = Float64(x + Float64(y * Float64(-1.0 / Float64(Float64(a - t) / z)))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(-1.0 * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -4e-212], t$95$3, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 1e+297], t$95$3, N[(x + N[(y * N[(-1.0 / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-1 \cdot \frac{a - z}{t}, y, x\right)\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
t_3 := \left(x + y\right) - \frac{y \cdot z}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-212}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+297}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-1}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or -3.99999999999999982e-212 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6461.1
Applied rewrites61.1%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1e297Initial program 75.9%
Taylor expanded in z around inf
lower-*.f6476.7
Applied rewrites76.7%
if 1e297 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6476.7
Applied rewrites76.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (* -1.0 (/ (- a z) t)) y x))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t))))
(t_3 (- (+ x y) (/ (* y z) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -4e-212)
t_3
(if (<= t_2 0.0)
t_1
(if (<= t_2 1e+297) t_3 (fma (/ z (- t a)) y x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((-1.0 * ((a - z) / t)), y, x);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double t_3 = (x + y) - ((y * z) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -4e-212) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 1e+297) {
tmp = t_3;
} else {
tmp = fma((z / (t - a)), y, x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-1.0 * Float64(Float64(a - z) / t)), y, x) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) t_3 = Float64(Float64(x + y) - Float64(Float64(y * z) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -4e-212) tmp = t_3; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 1e+297) tmp = t_3; else tmp = fma(Float64(z / Float64(t - a)), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(-1.0 * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -4e-212], t$95$3, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 1e+297], t$95$3, N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-1 \cdot \frac{a - z}{t}, y, x\right)\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
t_3 := \left(x + y\right) - \frac{y \cdot z}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-212}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+297}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t - a}, y, x\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or -3.99999999999999982e-212 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6461.1
Applied rewrites61.1%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1e297Initial program 75.9%
Taylor expanded in z around inf
lower-*.f6476.7
Applied rewrites76.7%
if 1e297 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_1 -4e-212)
(fma (- t z) (/ y (- a t)) (+ y x))
(if (<= t_1 0.0)
(fma (* -1.0 (/ (- a z) t)) y x)
(if (<= t_1 1e+297)
(- (+ x y) (/ (* y z) (- a t)))
(+ x (* y (/ -1.0 (/ (- a t) z)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -4e-212) {
tmp = fma((t - z), (y / (a - t)), (y + x));
} else if (t_1 <= 0.0) {
tmp = fma((-1.0 * ((a - z) / t)), y, x);
} else if (t_1 <= 1e+297) {
tmp = (x + y) - ((y * z) / (a - t));
} else {
tmp = x + (y * (-1.0 / ((a - t) / z)));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_1 <= -4e-212) tmp = fma(Float64(t - z), Float64(y / Float64(a - t)), Float64(y + x)); elseif (t_1 <= 0.0) tmp = fma(Float64(-1.0 * Float64(Float64(a - z) / t)), y, x); elseif (t_1 <= 1e+297) tmp = Float64(Float64(x + y) - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y * Float64(-1.0 / Float64(Float64(a - t) / z)))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-212], N[(N[(t - z), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(-1.0 * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+297], N[(N[(x + y), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-1.0 / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-212}:\\
\;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{a - t}, y + x\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-1 \cdot \frac{a - z}{t}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+297}:\\
\;\;\;\;\left(x + y\right) - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-1}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212Initial program 75.9%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6482.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6482.4
Applied rewrites82.4%
if -3.99999999999999982e-212 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6461.1
Applied rewrites61.1%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1e297Initial program 75.9%
Taylor expanded in z around inf
lower-*.f6476.7
Applied rewrites76.7%
if 1e297 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6476.7
Applied rewrites76.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_1 -4e-212)
(+ (fma (/ y (- t a)) (- z t) x) y)
(if (<= t_1 0.0)
(fma (* -1.0 (/ (- a z) t)) y x)
(if (<= t_1 1e+297)
(- (+ x y) (/ (* y z) (- a t)))
(+ x (* y (/ -1.0 (/ (- a t) z)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -4e-212) {
tmp = fma((y / (t - a)), (z - t), x) + y;
} else if (t_1 <= 0.0) {
tmp = fma((-1.0 * ((a - z) / t)), y, x);
} else if (t_1 <= 1e+297) {
tmp = (x + y) - ((y * z) / (a - t));
} else {
tmp = x + (y * (-1.0 / ((a - t) / z)));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_1 <= -4e-212) tmp = Float64(fma(Float64(y / Float64(t - a)), Float64(z - t), x) + y); elseif (t_1 <= 0.0) tmp = fma(Float64(-1.0 * Float64(Float64(a - z) / t)), y, x); elseif (t_1 <= 1e+297) tmp = Float64(Float64(x + y) - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y * Float64(-1.0 / Float64(Float64(a - t) / z)))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-212], N[(N[(N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(-1.0 * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+297], N[(N[(x + y), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-1.0 / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-212}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t - a}, z - t, x\right) + y\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-1 \cdot \frac{a - z}{t}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+297}:\\
\;\;\;\;\left(x + y\right) - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-1}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212Initial program 75.9%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6482.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6482.4
Applied rewrites82.4%
lift-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6482.4
Applied rewrites82.4%
if -3.99999999999999982e-212 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6461.1
Applied rewrites61.1%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1e297Initial program 75.9%
Taylor expanded in z around inf
lower-*.f6476.7
Applied rewrites76.7%
if 1e297 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6476.7
Applied rewrites76.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- y (* (/ y (- a t)) (- z t))) x))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_2 -4e-212)
t_1
(if (<= t_2 0.0) (fma (* -1.0 (/ (- a z) t)) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - ((y / (a - t)) * (z - t))) + x;
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 <= -4e-212) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma((-1.0 * ((a - z) / t)), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(Float64(y / Float64(a - t)) * Float64(z - t))) + x) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 <= -4e-212) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(-1.0 * Float64(Float64(a - z) / t)), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-212], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(-1.0 * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - \frac{y}{a - t} \cdot \left(z - t\right)\right) + x\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-1 \cdot \frac{a - z}{t}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 75.9%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6478.8
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6486.7
Applied rewrites86.7%
if -3.99999999999999982e-212 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6461.1
Applied rewrites61.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (+ x y) (* (/ z a) y)))) (if (<= a -1.05e+65) t_1 (if (<= a 3.6e-36) (fma (/ z (- t a)) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((z / a) * y);
double tmp;
if (a <= -1.05e+65) {
tmp = t_1;
} else if (a <= 3.6e-36) {
tmp = fma((z / (t - a)), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(z / a) * y)) tmp = 0.0 if (a <= -1.05e+65) tmp = t_1; elseif (a <= 3.6e-36) tmp = fma(Float64(z / Float64(t - a)), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.05e+65], t$95$1, If[LessEqual[a, 3.6e-36], N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{z}{a} \cdot y\\
\mathbf{if}\;a \leq -1.05 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{-36}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.04999999999999996e65 or 3.60000000000000032e-36 < a Initial program 75.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6463.6
Applied rewrites63.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6465.7
Applied rewrites65.7%
if -1.04999999999999996e65 < a < 3.60000000000000032e-36Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.2e+74) (fma 1.0 y x) (if (<= a 1.4e-33) (fma (/ z (- t a)) y x) (- (+ x y) (* z (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e+74) {
tmp = fma(1.0, y, x);
} else if (a <= 1.4e-33) {
tmp = fma((z / (t - a)), y, x);
} else {
tmp = (x + y) - (z * (y / a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.2e+74) tmp = fma(1.0, y, x); elseif (a <= 1.4e-33) tmp = fma(Float64(z / Float64(t - a)), y, x); else tmp = Float64(Float64(x + y) - Float64(z * Float64(y / a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.2e+74], N[(1.0 * y + x), $MachinePrecision], If[LessEqual[a, 1.4e-33], N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(1, y, x\right)\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if a < -4.1999999999999998e74Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in a around inf
Applied rewrites59.0%
if -4.1999999999999998e74 < a < 1.4e-33Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
if 1.4e-33 < a Initial program 75.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6463.6
Applied rewrites63.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6465.7
Applied rewrites65.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.2e+74) (fma 1.0 y x) (if (<= a 1e+64) (fma (/ z (- t a)) y x) (fma 1.0 y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e+74) {
tmp = fma(1.0, y, x);
} else if (a <= 1e+64) {
tmp = fma((z / (t - a)), y, x);
} else {
tmp = fma(1.0, y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.2e+74) tmp = fma(1.0, y, x); elseif (a <= 1e+64) tmp = fma(Float64(z / Float64(t - a)), y, x); else tmp = fma(1.0, y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.2e+74], N[(1.0 * y + x), $MachinePrecision], If[LessEqual[a, 1e+64], N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(1.0 * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(1, y, x\right)\\
\mathbf{elif}\;a \leq 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, y, x\right)\\
\end{array}
\end{array}
if a < -4.1999999999999998e74 or 1.00000000000000002e64 < a Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in a around inf
Applied rewrites59.0%
if -4.1999999999999998e74 < a < 1.00000000000000002e64Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.6e+48) (fma 1.0 y x) (if (<= a 1.4e-33) (fma (/ z t) y x) (fma 1.0 y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.6e+48) {
tmp = fma(1.0, y, x);
} else if (a <= 1.4e-33) {
tmp = fma((z / t), y, x);
} else {
tmp = fma(1.0, y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.6e+48) tmp = fma(1.0, y, x); elseif (a <= 1.4e-33) tmp = fma(Float64(z / t), y, x); else tmp = fma(1.0, y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.6e+48], N[(1.0 * y + x), $MachinePrecision], If[LessEqual[a, 1.4e-33], N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision], N[(1.0 * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.6 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(1, y, x\right)\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, y, x\right)\\
\end{array}
\end{array}
if a < -8.59999999999999957e48 or 1.4e-33 < a Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in a around inf
Applied rewrites59.0%
if -8.59999999999999957e48 < a < 1.4e-33Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in a around 0
lower-/.f6462.3
Applied rewrites62.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6462.3
Applied rewrites62.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (<= t_1 -4e-212)
(fma 1.0 y x)
(if (<= t_1 0.0) (* 1.0 x) (fma 1.0 y x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_1 <= -4e-212) {
tmp = fma(1.0, y, x);
} else if (t_1 <= 0.0) {
tmp = 1.0 * x;
} else {
tmp = fma(1.0, y, x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_1 <= -4e-212) tmp = fma(1.0, y, x); elseif (t_1 <= 0.0) tmp = Float64(1.0 * x); else tmp = fma(1.0, y, x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-212], N[(1.0 * y + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(1.0 * x), $MachinePrecision], N[(1.0 * y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-212}:\\
\;\;\;\;\mathsf{fma}\left(1, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, y, x\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 75.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
lift-*.f64N/A
mul-1-negN/A
lift--.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in a around inf
Applied rewrites59.0%
if -3.99999999999999982e-212 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 75.9%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
sum-to-multN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6473.1
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.0
Applied rewrites79.0%
Taylor expanded in x around inf
Applied rewrites50.3%
(FPCore (x y z t a) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a) {
return 1.0 * x;
}
def code(x, y, z, t, a): return 1.0 * x
function code(x, y, z, t, a) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 75.9%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
sum-to-multN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f6473.1
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.0
Applied rewrites79.0%
Taylor expanded in x around inf
Applied rewrites50.3%
herbie shell --seed 2025148
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
(- (+ x y) (/ (* (- z t) y) (- a t))))