
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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 - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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 - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) (- a z)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z))))
(t_3 (+ x (/ (fma (- x) (- y z) (* (- y z) t)) (- a z)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e-254)
t_3
(if (<= t_2 0.0)
(*
-1.0
(*
x
(fma
-1.0
(/ t x)
(* -1.0 (/ (- (+ y (* -1.0 (/ (- (* t y) (* a t)) x))) a) z)))))
(if (<= t_2 1e+298) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double t_3 = x + (fma(-x, (y - z), ((y - z) * t)) / (a - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e-254) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = -1.0 * (x * fma(-1.0, (t / x), (-1.0 * (((y + (-1.0 * (((t * y) - (a * t)) / x))) - a) / z))));
} else if (t_2 <= 1e+298) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) t_3 = Float64(x + Float64(fma(Float64(-x), Float64(y - z), Float64(Float64(y - z) * t)) / Float64(a - z))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e-254) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(-1.0 * Float64(x * fma(-1.0, Float64(t / x), Float64(-1.0 * Float64(Float64(Float64(y + Float64(-1.0 * Float64(Float64(Float64(t * y) - Float64(a * t)) / x))) - a) / z))))); elseif (t_2 <= 1e+298) tmp = t_3; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[((-x) * N[(y - z), $MachinePrecision] + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-254], t$95$3, If[LessEqual[t$95$2, 0.0], N[(-1.0 * N[(x * N[(-1.0 * N[(t / x), $MachinePrecision] + N[(-1.0 * N[(N[(N[(y + N[(-1.0 * N[(N[(N[(t * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+298], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
t_3 := x + \frac{\mathsf{fma}\left(-x, y - z, \left(y - z\right) \cdot t\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-254}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;-1 \cdot \left(x \cdot \mathsf{fma}\left(-1, \frac{t}{x}, -1 \cdot \frac{\left(y + -1 \cdot \frac{t \cdot y - a \cdot t}{x}\right) - a}{z}\right)\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -inf.0 or 9.9999999999999996e297 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 39.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6481.6
Applied rewrites81.6%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -5.0000000000000003e-254 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 9.9999999999999996e297Initial program 96.7%
Taylor expanded in x around 0
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6496.7
Applied rewrites96.7%
if -5.0000000000000003e-254 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 10.8%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6411.2
Applied rewrites11.2%
Taylor expanded in a around inf
Applied rewrites9.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites74.5%
Taylor expanded in z around -inf
lower-fma.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites92.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) (- a z)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z))))
(t_3 (+ x (/ (fma (- x) (- y z) (* (- y z) t)) (- a z)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e-254)
t_3
(if (<= t_2 0.0)
(+ t (- (/ (* (- t x) (- y a)) z)))
(if (<= t_2 1e+298) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double t_3 = x + (fma(-x, (y - z), ((y - z) * t)) / (a - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e-254) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = t + -(((t - x) * (y - a)) / z);
} else if (t_2 <= 1e+298) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) t_3 = Float64(x + Float64(fma(Float64(-x), Float64(y - z), Float64(Float64(y - z) * t)) / Float64(a - z))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e-254) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(t + Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z))); elseif (t_2 <= 1e+298) tmp = t_3; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[((-x) * N[(y - z), $MachinePrecision] + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-254], t$95$3, If[LessEqual[t$95$2, 0.0], N[(t + (-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$2, 1e+298], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
t_3 := x + \frac{\mathsf{fma}\left(-x, y - z, \left(y - z\right) \cdot t\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-254}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t + \left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -inf.0 or 9.9999999999999996e297 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 39.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6481.6
Applied rewrites81.6%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -5.0000000000000003e-254 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 9.9999999999999996e297Initial program 96.7%
Taylor expanded in x around 0
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6496.7
Applied rewrites96.7%
if -5.0000000000000003e-254 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 10.8%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6411.2
Applied rewrites11.2%
Taylor expanded in z around -inf
lower-+.f64N/A
mul-1-negN/A
distribute-rgt-out--N/A
lower-neg.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f6493.0
Applied rewrites93.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) (- a z)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e-254)
t_2
(if (<= t_2 0.0)
(+ t (- (/ (* (- t x) (- y a)) z)))
(if (<= t_2 1e+298) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e-254) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t + -(((t - x) * (y - a)) / z);
} else if (t_2 <= 1e+298) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e-254) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(t + Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z))); elseif (t_2 <= 1e+298) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-254], t$95$2, If[LessEqual[t$95$2, 0.0], N[(t + (-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$2, 1e+298], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-254}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t + \left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -inf.0 or 9.9999999999999996e297 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 39.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6481.6
Applied rewrites81.6%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -5.0000000000000003e-254 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 9.9999999999999996e297Initial program 96.7%
if -5.0000000000000003e-254 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 10.8%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6411.2
Applied rewrites11.2%
Taylor expanded in z around -inf
lower-+.f64N/A
mul-1-negN/A
distribute-rgt-out--N/A
lower-neg.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f6493.0
Applied rewrites93.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) (- a z)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -1e+139)
t_1
(if (<= t_2 1e-60)
(-
(*
x
(-
(fma -1.0 (/ (* t (- y z)) (* x (- a z))) (/ y (- a z)))
(+ 1.0 (/ z (- a z))))))
(if (<= t_2 1e+298)
(+ x (/ (fma (- x) (- y z) (* (- y z) t)) (- a z)))
t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -1e+139) {
tmp = t_1;
} else if (t_2 <= 1e-60) {
tmp = -(x * (fma(-1.0, ((t * (y - z)) / (x * (a - z))), (y / (a - z))) - (1.0 + (z / (a - z)))));
} else if (t_2 <= 1e+298) {
tmp = x + (fma(-x, (y - z), ((y - z) * t)) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -1e+139) tmp = t_1; elseif (t_2 <= 1e-60) tmp = Float64(-Float64(x * Float64(fma(-1.0, Float64(Float64(t * Float64(y - z)) / Float64(x * Float64(a - z))), Float64(y / Float64(a - z))) - Float64(1.0 + Float64(z / Float64(a - z)))))); elseif (t_2 <= 1e+298) tmp = Float64(x + Float64(fma(Float64(-x), Float64(y - z), Float64(Float64(y - z) * t)) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+139], t$95$1, If[LessEqual[t$95$2, 1e-60], (-N[(x * N[(N[(-1.0 * N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(x * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t$95$2, 1e+298], N[(x + N[(N[((-x) * N[(y - z), $MachinePrecision] + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-60}:\\
\;\;\;\;-x \cdot \left(\mathsf{fma}\left(-1, \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}, \frac{y}{a - z}\right) - \left(1 + \frac{z}{a - z}\right)\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;x + \frac{\mathsf{fma}\left(-x, y - z, \left(y - z\right) \cdot t\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -1.00000000000000003e139 or 9.9999999999999996e297 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 50.0%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6482.5
Applied rewrites82.5%
if -1.00000000000000003e139 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 9.9999999999999997e-61Initial program 75.9%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6468.4
Applied rewrites68.4%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.1%
if 9.9999999999999997e-61 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 9.9999999999999996e297Initial program 96.8%
Taylor expanded in x around 0
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6496.8
Applied rewrites96.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1
(*
-1.0
(*
x
(-
(fma -1.0 (* (/ t x) (/ (- y z) (- a z))) (/ y (- a z)))
(+ 1.0 (/ z (- a z))))))))
(if (<= x -2.45e-156)
t_1
(if (<= x 4.4e-94) (fma (- y z) (/ (- t x) (- a z)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -1.0 * (x * (fma(-1.0, ((t / x) * ((y - z) / (a - z))), (y / (a - z))) - (1.0 + (z / (a - z)))));
double tmp;
if (x <= -2.45e-156) {
tmp = t_1;
} else if (x <= 4.4e-94) {
tmp = fma((y - z), ((t - x) / (a - z)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(-1.0 * Float64(x * Float64(fma(-1.0, Float64(Float64(t / x) * Float64(Float64(y - z) / Float64(a - z))), Float64(y / Float64(a - z))) - Float64(1.0 + Float64(z / Float64(a - z)))))) tmp = 0.0 if (x <= -2.45e-156) tmp = t_1; elseif (x <= 4.4e-94) tmp = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-1.0 * N[(x * N[(N[(-1.0 * N[(N[(t / x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.45e-156], t$95$1, If[LessEqual[x, 4.4e-94], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -1 \cdot \left(x \cdot \left(\mathsf{fma}\left(-1, \frac{t}{x} \cdot \frac{y - z}{a - z}, \frac{y}{a - z}\right) - \left(1 + \frac{z}{a - z}\right)\right)\right)\\
\mathbf{if}\;x \leq -2.45 \cdot 10^{-156}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-94}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.44999999999999976e-156 or 4.40000000000000002e-94 < x Initial program 62.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6477.1
Applied rewrites77.1%
Taylor expanded in a around inf
Applied rewrites28.3%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.3%
if -2.44999999999999976e-156 < x < 4.40000000000000002e-94Initial program 81.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6486.3
Applied rewrites86.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) (- a z)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -2e-266)
t_1
(if (<= t_2 0.0) (+ t (- (/ (* (- t x) (- y a)) z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -2e-266) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t + -(((t - x) * (y - a)) / z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -2e-266) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(t + Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-266], t$95$1, If[LessEqual[t$95$2, 0.0], N[(t + (-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t + \left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -2e-266 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 72.9%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6485.6
Applied rewrites85.6%
if -2e-266 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 9.0%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f649.8
Applied rewrites9.8%
Taylor expanded in z around -inf
lower-+.f64N/A
mul-1-negN/A
distribute-rgt-out--N/A
lower-neg.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-/.f6494.6
Applied rewrites94.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) (- a z)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -2e-266) t_1 (if (<= t_2 0.0) (+ t (/ (* x y) z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -2e-266) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t + ((x * y) / z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -2e-266) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(t + Float64(Float64(x * y) / z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-266], t$95$1, If[LessEqual[t$95$2, 0.0], N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t + \frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -2e-266 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 72.9%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6485.6
Applied rewrites85.6%
if -2e-266 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 9.0%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.6%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6469.4
Applied rewrites69.4%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f6469.2
Applied rewrites69.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -2.25e+43)
t_1
(if (<= a 3.5e-212)
(+ t (* y (/ (- x t) z)))
(if (<= a 1.6e+132) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / a), x);
double tmp;
if (a <= -2.25e+43) {
tmp = t_1;
} else if (a <= 3.5e-212) {
tmp = t + (y * ((x - t) / z));
} else if (a <= 1.6e+132) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -2.25e+43) tmp = t_1; elseif (a <= 3.5e-212) tmp = Float64(t + Float64(y * Float64(Float64(x - t) / z))); elseif (a <= 1.6e+132) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.25e+43], t$95$1, If[LessEqual[a, 3.5e-212], N[(t + N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e+132], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -2.25 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-212}:\\
\;\;\;\;t + y \cdot \frac{x - t}{z}\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+132}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.25e43 or 1.5999999999999999e132 < a Initial program 67.9%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.0
Applied rewrites79.0%
if -2.25e43 < a < 3.4999999999999998e-212Initial program 66.7%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.2%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6468.5
Applied rewrites68.5%
Taylor expanded in y around 0
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6471.9
Applied rewrites71.9%
if 3.4999999999999998e-212 < a < 1.5999999999999999e132Initial program 70.1%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6478.1
Applied rewrites78.1%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6456.8
Applied rewrites56.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- t x) a) x)))
(if (<= a -9.5e+101)
t_1
(if (<= a 3.5e-212)
(+ t (* y (/ (- x t) z)))
(if (<= a 1.65e+157) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((t - x) / a), x);
double tmp;
if (a <= -9.5e+101) {
tmp = t_1;
} else if (a <= 3.5e-212) {
tmp = t + (y * ((x - t) / z));
} else if (a <= 1.65e+157) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -9.5e+101) tmp = t_1; elseif (a <= 3.5e-212) tmp = Float64(t + Float64(y * Float64(Float64(x - t) / z))); elseif (a <= 1.65e+157) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -9.5e+101], t$95$1, If[LessEqual[a, 3.5e-212], N[(t + N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.65e+157], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-212}:\\
\;\;\;\;t + y \cdot \frac{x - t}{z}\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{+157}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.49999999999999947e101 or 1.6500000000000001e157 < a Initial program 67.7%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6471.2
Applied rewrites71.2%
if -9.49999999999999947e101 < a < 3.4999999999999998e-212Initial program 67.3%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites57.2%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6464.2
Applied rewrites64.2%
Taylor expanded in y around 0
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6467.9
Applied rewrites67.9%
if 3.4999999999999998e-212 < a < 1.6500000000000001e157Initial program 69.5%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6478.3
Applied rewrites78.3%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6456.1
Applied rewrites56.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.3e+48)
(+ t (/ (* x y) z))
(if (<= z 9.5e-135)
(+ x (/ (* t y) a))
(if (<= z 7e+155) (* y (/ (- x t) z)) (* t (- 1.0 (/ y z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.3e+48) {
tmp = t + ((x * y) / z);
} else if (z <= 9.5e-135) {
tmp = x + ((t * y) / a);
} else if (z <= 7e+155) {
tmp = y * ((x - t) / z);
} else {
tmp = t * (1.0 - (y / z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.3d+48)) then
tmp = t + ((x * y) / z)
else if (z <= 9.5d-135) then
tmp = x + ((t * y) / a)
else if (z <= 7d+155) then
tmp = y * ((x - t) / z)
else
tmp = t * (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.3e+48) {
tmp = t + ((x * y) / z);
} else if (z <= 9.5e-135) {
tmp = x + ((t * y) / a);
} else if (z <= 7e+155) {
tmp = y * ((x - t) / z);
} else {
tmp = t * (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.3e+48: tmp = t + ((x * y) / z) elif z <= 9.5e-135: tmp = x + ((t * y) / a) elif z <= 7e+155: tmp = y * ((x - t) / z) else: tmp = t * (1.0 - (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.3e+48) tmp = Float64(t + Float64(Float64(x * y) / z)); elseif (z <= 9.5e-135) tmp = Float64(x + Float64(Float64(t * y) / a)); elseif (z <= 7e+155) tmp = Float64(y * Float64(Float64(x - t) / z)); else tmp = Float64(t * Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.3e+48) tmp = t + ((x * y) / z); elseif (z <= 9.5e-135) tmp = x + ((t * y) / a); elseif (z <= 7e+155) tmp = y * ((x - t) / z); else tmp = t * (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.3e+48], N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-135], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+155], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{+48}:\\
\;\;\;\;t + \frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-135}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+155}:\\
\;\;\;\;y \cdot \frac{x - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -5.3e48Initial program 42.5%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.1%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6459.8
Applied rewrites59.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f6459.1
Applied rewrites59.1%
if -5.3e48 < z < 9.50000000000000007e-135Initial program 89.2%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6470.3
Applied rewrites70.3%
Taylor expanded in x around 0
Applied rewrites57.1%
if 9.50000000000000007e-135 < z < 6.99999999999999969e155Initial program 73.0%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites45.5%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6449.0
Applied rewrites49.0%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6431.8
Applied rewrites31.8%
if 6.99999999999999969e155 < z Initial program 29.0%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.9%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6460.9
Applied rewrites60.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6459.9
Applied rewrites59.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -9.5e+124)
x
(if (<= a -2.1e-163)
(+ t (/ (* x y) z))
(if (<= a 1.25e+118) (* t (- 1.0 (/ y z))) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+124) {
tmp = x;
} else if (a <= -2.1e-163) {
tmp = t + ((x * y) / z);
} else if (a <= 1.25e+118) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-9.5d+124)) then
tmp = x
else if (a <= (-2.1d-163)) then
tmp = t + ((x * y) / z)
else if (a <= 1.25d+118) then
tmp = t * (1.0d0 - (y / z))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+124) {
tmp = x;
} else if (a <= -2.1e-163) {
tmp = t + ((x * y) / z);
} else if (a <= 1.25e+118) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.5e+124: tmp = x elif a <= -2.1e-163: tmp = t + ((x * y) / z) elif a <= 1.25e+118: tmp = t * (1.0 - (y / z)) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e+124) tmp = x; elseif (a <= -2.1e-163) tmp = Float64(t + Float64(Float64(x * y) / z)); elseif (a <= 1.25e+118) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.5e+124) tmp = x; elseif (a <= -2.1e-163) tmp = t + ((x * y) / z); elseif (a <= 1.25e+118) tmp = t * (1.0 - (y / z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e+124], x, If[LessEqual[a, -2.1e-163], N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e+118], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+124}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -2.1 \cdot 10^{-163}:\\
\;\;\;\;t + \frac{x \cdot y}{z}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+118}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.50000000000000004e124 or 1.24999999999999993e118 < a Initial program 67.7%
Taylor expanded in a around inf
Applied rewrites51.2%
if -9.50000000000000004e124 < a < -2.09999999999999998e-163Initial program 70.1%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites42.8%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6445.8
Applied rewrites45.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f6440.5
Applied rewrites40.5%
if -2.09999999999999998e-163 < a < 1.24999999999999993e118Initial program 67.3%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites57.6%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6465.6
Applied rewrites65.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ t (- a z)) x)))
(if (<= a -2.25e+43)
t_1
(if (<= a 3.8e-102) (+ t (* y (/ (- x t) z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (t / (a - z)), x);
double tmp;
if (a <= -2.25e+43) {
tmp = t_1;
} else if (a <= 3.8e-102) {
tmp = t + (y * ((x - t) / z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(t / Float64(a - z)), x) tmp = 0.0 if (a <= -2.25e+43) tmp = t_1; elseif (a <= 3.8e-102) tmp = Float64(t + Float64(y * Float64(Float64(x - t) / z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.25e+43], t$95$1, If[LessEqual[a, 3.8e-102], N[(t + N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)\\
\mathbf{if}\;a \leq -2.25 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{-102}:\\
\;\;\;\;t + y \cdot \frac{x - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.25e43 or 3.80000000000000026e-102 < a Initial program 69.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6486.4
Applied rewrites86.4%
Taylor expanded in x around 0
Applied rewrites74.5%
if -2.25e43 < a < 3.80000000000000026e-102Initial program 66.5%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.5%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6468.9
Applied rewrites68.9%
Taylor expanded in y around 0
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6472.7
Applied rewrites72.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -9.5e+124)
x
(if (<= a -3.15e-118)
t
(if (<= a -5.8e-292) (* x (/ y z)) (if (<= a 8.2e+117) t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+124) {
tmp = x;
} else if (a <= -3.15e-118) {
tmp = t;
} else if (a <= -5.8e-292) {
tmp = x * (y / z);
} else if (a <= 8.2e+117) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-9.5d+124)) then
tmp = x
else if (a <= (-3.15d-118)) then
tmp = t
else if (a <= (-5.8d-292)) then
tmp = x * (y / z)
else if (a <= 8.2d+117) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+124) {
tmp = x;
} else if (a <= -3.15e-118) {
tmp = t;
} else if (a <= -5.8e-292) {
tmp = x * (y / z);
} else if (a <= 8.2e+117) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.5e+124: tmp = x elif a <= -3.15e-118: tmp = t elif a <= -5.8e-292: tmp = x * (y / z) elif a <= 8.2e+117: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e+124) tmp = x; elseif (a <= -3.15e-118) tmp = t; elseif (a <= -5.8e-292) tmp = Float64(x * Float64(y / z)); elseif (a <= 8.2e+117) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.5e+124) tmp = x; elseif (a <= -3.15e-118) tmp = t; elseif (a <= -5.8e-292) tmp = x * (y / z); elseif (a <= 8.2e+117) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e+124], x, If[LessEqual[a, -3.15e-118], t, If[LessEqual[a, -5.8e-292], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e+117], t, x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+124}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -3.15 \cdot 10^{-118}:\\
\;\;\;\;t\\
\mathbf{elif}\;a \leq -5.8 \cdot 10^{-292}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+117}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.50000000000000004e124 or 8.1999999999999999e117 < a Initial program 67.7%
Taylor expanded in a around inf
Applied rewrites51.2%
if -9.50000000000000004e124 < a < -3.1499999999999999e-118 or -5.79999999999999985e-292 < a < 8.1999999999999999e117Initial program 68.9%
Taylor expanded in z around inf
Applied rewrites30.5%
if -3.1499999999999999e-118 < a < -5.79999999999999985e-292Initial program 65.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6469.8
Applied rewrites69.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6431.5
Applied rewrites31.5%
Taylor expanded in a around 0
lower-/.f6432.6
Applied rewrites32.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- t x) a) x)))
(if (<= a -9.5e+101)
t_1
(if (<= a 3.3e-67) (+ t (* y (/ (- x t) z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((t - x) / a), x);
double tmp;
if (a <= -9.5e+101) {
tmp = t_1;
} else if (a <= 3.3e-67) {
tmp = t + (y * ((x - t) / z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -9.5e+101) tmp = t_1; elseif (a <= 3.3e-67) tmp = Float64(t + Float64(y * Float64(Float64(x - t) / z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -9.5e+101], t$95$1, If[LessEqual[a, 3.3e-67], N[(t + N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-67}:\\
\;\;\;\;t + y \cdot \frac{x - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.49999999999999947e101 or 3.3000000000000002e-67 < a Initial program 69.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6464.6
Applied rewrites64.6%
if -9.49999999999999947e101 < a < 3.3000000000000002e-67Initial program 67.3%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites57.9%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6464.9
Applied rewrites64.9%
Taylor expanded in y around 0
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6469.0
Applied rewrites69.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.5e+61) (+ t (/ (* x y) z)) (if (<= z 7e+155) (fma y (/ (- t x) a) x) (* t (- 1.0 (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e+61) {
tmp = t + ((x * y) / z);
} else if (z <= 7e+155) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t * (1.0 - (y / z));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e+61) tmp = Float64(t + Float64(Float64(x * y) / z)); elseif (z <= 7e+155) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = Float64(t * Float64(1.0 - Float64(y / z))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e+61], N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+155], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+61}:\\
\;\;\;\;t + \frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -9.49999999999999959e61Initial program 41.0%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.1%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6460.4
Applied rewrites60.4%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f6459.9
Applied rewrites59.9%
if -9.49999999999999959e61 < z < 6.99999999999999969e155Initial program 83.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6462.5
Applied rewrites62.5%
if 6.99999999999999969e155 < z Initial program 29.0%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.9%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6460.9
Applied rewrites60.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6459.9
Applied rewrites59.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.85e+64) (+ t (/ (* x y) z)) (if (<= z 2.5e-66) (* x (- 1.0 (/ y a))) (* t (- 1.0 (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+64) {
tmp = t + ((x * y) / z);
} else if (z <= 2.5e-66) {
tmp = x * (1.0 - (y / a));
} else {
tmp = t * (1.0 - (y / z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.85d+64)) then
tmp = t + ((x * y) / z)
else if (z <= 2.5d-66) then
tmp = x * (1.0d0 - (y / a))
else
tmp = t * (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+64) {
tmp = t + ((x * y) / z);
} else if (z <= 2.5e-66) {
tmp = x * (1.0 - (y / a));
} else {
tmp = t * (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.85e+64: tmp = t + ((x * y) / z) elif z <= 2.5e-66: tmp = x * (1.0 - (y / a)) else: tmp = t * (1.0 - (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+64) tmp = Float64(t + Float64(Float64(x * y) / z)); elseif (z <= 2.5e-66) tmp = Float64(x * Float64(1.0 - Float64(y / a))); else tmp = Float64(t * Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.85e+64) tmp = t + ((x * y) / z); elseif (z <= 2.5e-66) tmp = x * (1.0 - (y / a)); else tmp = t * (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+64], N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-66], N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+64}:\\
\;\;\;\;t + \frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-66}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -1.84999999999999992e64Initial program 40.8%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.1%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6460.3
Applied rewrites60.3%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f6459.8
Applied rewrites59.8%
if -1.84999999999999992e64 < z < 2.49999999999999981e-66Initial program 88.7%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6491.1
Applied rewrites91.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
sub-divN/A
mul-1-negN/A
lower-neg.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6457.9
Applied rewrites57.9%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6453.1
Applied rewrites53.1%
if 2.49999999999999981e-66 < z Initial program 52.4%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites54.5%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6455.7
Applied rewrites55.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6447.2
Applied rewrites47.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.2e+125) x (if (<= a 1.25e+118) (* t (- 1.0 (/ y z))) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e+125) {
tmp = x;
} else if (a <= 1.25e+118) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.2d+125)) then
tmp = x
else if (a <= 1.25d+118) then
tmp = t * (1.0d0 - (y / z))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e+125) {
tmp = x;
} else if (a <= 1.25e+118) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.2e+125: tmp = x elif a <= 1.25e+118: tmp = t * (1.0 - (y / z)) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.2e+125) tmp = x; elseif (a <= 1.25e+118) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.2e+125) tmp = x; elseif (a <= 1.25e+118) tmp = t * (1.0 - (y / z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.2e+125], x, If[LessEqual[a, 1.25e+118], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+125}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+118}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.19999999999999983e125 or 1.24999999999999993e118 < a Initial program 67.7%
Taylor expanded in a around inf
Applied rewrites51.1%
if -3.19999999999999983e125 < a < 1.24999999999999993e118Initial program 68.2%
Taylor expanded in z around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites52.6%
Taylor expanded in a around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6458.8
Applied rewrites58.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6447.5
Applied rewrites47.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.5e+124) x (if (<= a 8.2e+117) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+124) {
tmp = x;
} else if (a <= 8.2e+117) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-9.5d+124)) then
tmp = x
else if (a <= 8.2d+117) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+124) {
tmp = x;
} else if (a <= 8.2e+117) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.5e+124: tmp = x elif a <= 8.2e+117: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e+124) tmp = x; elseif (a <= 8.2e+117) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.5e+124) tmp = x; elseif (a <= 8.2e+117) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e+124], x, If[LessEqual[a, 8.2e+117], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+124}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+117}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.50000000000000004e124 or 8.1999999999999999e117 < a Initial program 67.7%
Taylor expanded in a around inf
Applied rewrites51.2%
if -9.50000000000000004e124 < a < 8.1999999999999999e117Initial program 68.2%
Taylor expanded in z around inf
Applied rewrites31.6%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 68.1%
Taylor expanded in z around inf
Applied rewrites25.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* (/ y z) (- t x)))))
(if (< z -1.2536131056095036e+188)
t_1
(if (< z 4.446702369113811e+64)
(+ x (/ (- y z) (/ (- a z) (- t x))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t - ((y / z) * (t - x))
if (z < (-1.2536131056095036d+188)) then
tmp = t_1
else if (z < 4.446702369113811d+64) then
tmp = x + ((y - z) / ((a - z) / (t - x)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((y / z) * (t - x)) tmp = 0 if z < -1.2536131056095036e+188: tmp = t_1 elif z < 4.446702369113811e+64: tmp = x + ((y - z) / ((a - z) / (t - x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x))) tmp = 0.0 if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((y / z) * (t - x)); tmp = 0.0; if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = x + ((y - z) / ((a - z) / (t - x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
\mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2025095
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))
(+ x (/ (* (- y z) (- t x)) (- a z))))