
(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(y - z) * Float64(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[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
Herbie found 20 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(y - z) * Float64(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[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (* (/ -1.0 (- z a)) (- y z)) x))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -1e-273)
t_1
(if (<= t_2 0.0) (fma (/ (- y a) z) (- x t) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((-1.0 / (z - a)) * (y - z)), x);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -1e-273) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(((y - a) / z), (x - t), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(-1.0 / Float64(z - a)) * Float64(y - z)), x) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -1e-273) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(Float64(y - a) / z), Float64(x - t), t); 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[(-1.0 / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-273], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{-1}{z - a} \cdot \left(y - z\right), x\right)\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-273}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1e-273 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.8
Applied rewrites84.8%
if -1e-273 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
distribute-rgt-out--N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites53.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -1e-273)
(- x (* (- z y) (/ (- x t) (- z a))))
(if (<= t_1 0.0)
(fma (/ (- y a) z) (- x t) t)
(+ x (/ (- z y) (/ (- z a) (- t x))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-273) {
tmp = x - ((z - y) * ((x - t) / (z - a)));
} else if (t_1 <= 0.0) {
tmp = fma(((y - a) / z), (x - t), t);
} else {
tmp = x + ((z - y) / ((z - a) / (t - x)));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -1e-273) tmp = Float64(x - Float64(Float64(z - y) * Float64(Float64(x - t) / Float64(z - a)))); elseif (t_1 <= 0.0) tmp = fma(Float64(Float64(y - a) / z), Float64(x - t), t); else tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(z - a) / Float64(t - x)))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-273], N[(x - N[(N[(z - y), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-273}:\\
\;\;\;\;x - \left(z - y\right) \cdot \frac{x - t}{z - a}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{z - a}{t - x}}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1e-273Initial program 80.4%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.4
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.4
Applied rewrites80.4%
if -1e-273 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
distribute-rgt-out--N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites53.4%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.4%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.5
Applied rewrites80.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x t) (- z a))) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -1e-273)
(- x (* (- z y) t_1))
(if (<= t_2 0.0) (fma (/ (- y a) z) (- x t) t) (fma t_1 (- y z) x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - t) / (z - a);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -1e-273) {
tmp = x - ((z - y) * t_1);
} else if (t_2 <= 0.0) {
tmp = fma(((y - a) / z), (x - t), t);
} else {
tmp = fma(t_1, (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x - t) / Float64(z - a)) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -1e-273) tmp = Float64(x - Float64(Float64(z - y) * t_1)); elseif (t_2 <= 0.0) tmp = fma(Float64(Float64(y - a) / z), Float64(x - t), t); else tmp = fma(t_1, Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-273], N[(x - N[(N[(z - y), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - t}{z - a}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-273}:\\
\;\;\;\;x - \left(z - y\right) \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1e-273Initial program 80.4%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.4
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.4
Applied rewrites80.4%
if -1e-273 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
distribute-rgt-out--N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites53.4%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6480.5
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.5
Applied rewrites80.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x t) (- z a)) (- y z) x))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -1e-273)
t_1
(if (<= t_2 0.0) (fma (/ (- y a) z) (- x t) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - t) / (z - a)), (y - z), x);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -1e-273) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(((y - a) / z), (x - t), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - t) / Float64(z - a)), Float64(y - z), x) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -1e-273) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(Float64(y - a) / z), Float64(x - t), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-273], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - t}{z - a}, y - z, x\right)\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-273}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1e-273 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6480.5
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.5
Applied rewrites80.5%
if -1e-273 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
distribute-rgt-out--N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites53.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ t (- a z)))))
(t_2 (fma (/ (- y a) z) (- x t) t)))
(if (<= z -9e+22)
t_2
(if (<= z -1.8e-191)
t_1
(if (<= z 1.2e-143)
(fma (- t x) (/ y a) x)
(if (<= z 1.55e+75) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / (a - z)));
double t_2 = fma(((y - a) / z), (x - t), t);
double tmp;
if (z <= -9e+22) {
tmp = t_2;
} else if (z <= -1.8e-191) {
tmp = t_1;
} else if (z <= 1.2e-143) {
tmp = fma((t - x), (y / a), x);
} else if (z <= 1.55e+75) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) t_2 = fma(Float64(Float64(y - a) / z), Float64(x - t), t) tmp = 0.0 if (z <= -9e+22) tmp = t_2; elseif (z <= -1.8e-191) tmp = t_1; elseif (z <= 1.2e-143) tmp = fma(Float64(t - x), Float64(y / a), x); elseif (z <= 1.55e+75) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -9e+22], t$95$2, If[LessEqual[z, -1.8e-191], t$95$1, If[LessEqual[z, 1.2e-143], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.55e+75], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
t_2 := \mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+22}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-191}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-143}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -8.9999999999999996e22 or 1.5500000000000001e75 < z Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
distribute-rgt-out--N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites53.4%
if -8.9999999999999996e22 < z < -1.8000000000000001e-191 or 1.1999999999999999e-143 < z < 1.5500000000000001e75Initial program 80.4%
Taylor expanded in x around 0
Applied rewrites64.0%
if -1.8000000000000001e-191 < z < 1.1999999999999999e-143Initial program 80.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.8
Applied rewrites84.8%
Taylor expanded in z around 0
lower-/.f6448.8
Applied rewrites48.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.6e+22)
(fma (/ (- y a) z) (- x t) t)
(if (<= z 1.8e-143)
(+ x (* (- y z) (/ (- t x) a)))
(if (<= z 1.55e+75)
(+ x (* (- y z) (/ t (- a z))))
(- t (/ (- t x) (/ z (- y a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+22) {
tmp = fma(((y - a) / z), (x - t), t);
} else if (z <= 1.8e-143) {
tmp = x + ((y - z) * ((t - x) / a));
} else if (z <= 1.55e+75) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t - ((t - x) / (z / (y - a)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+22) tmp = fma(Float64(Float64(y - a) / z), Float64(x - t), t); elseif (z <= 1.8e-143) tmp = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / a))); elseif (z <= 1.55e+75) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = Float64(t - Float64(Float64(t - x) / Float64(z / Float64(y - a)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+22], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 1.8e-143], N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+75], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(N[(t - x), $MachinePrecision] / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-143}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+75}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t - \frac{t - x}{\frac{z}{y - a}}\\
\end{array}
\end{array}
if z < -6.5999999999999996e22Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
distribute-rgt-out--N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites53.4%
if -6.5999999999999996e22 < z < 1.7999999999999999e-143Initial program 80.4%
Taylor expanded in z around 0
Applied rewrites51.8%
if 1.7999999999999999e-143 < z < 1.5500000000000001e75Initial program 80.4%
Taylor expanded in x around 0
Applied rewrites64.0%
if 1.5500000000000001e75 < z Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f6453.4
Applied rewrites53.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y a) z) (- x t) t)))
(if (<= z -6.6e+22)
t_1
(if (<= z 1.8e-143)
(+ x (* (- y z) (/ (- t x) a)))
(if (<= z 1.55e+75) (+ x (* (- y z) (/ t (- a z)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - a) / z), (x - t), t);
double tmp;
if (z <= -6.6e+22) {
tmp = t_1;
} else if (z <= 1.8e-143) {
tmp = x + ((y - z) * ((t - x) / a));
} else if (z <= 1.55e+75) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - a) / z), Float64(x - t), t) tmp = 0.0 if (z <= -6.6e+22) tmp = t_1; elseif (z <= 1.8e-143) tmp = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / a))); elseif (z <= 1.55e+75) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -6.6e+22], t$95$1, If[LessEqual[z, 1.8e-143], N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+75], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-143}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+75}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.5999999999999996e22 or 1.5500000000000001e75 < z Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
distribute-rgt-out--N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites53.4%
if -6.5999999999999996e22 < z < 1.7999999999999999e-143Initial program 80.4%
Taylor expanded in z around 0
Applied rewrites51.8%
if 1.7999999999999999e-143 < z < 1.5500000000000001e75Initial program 80.4%
Taylor expanded in x around 0
Applied rewrites64.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y a) z) (- x t) t)))
(if (<= z -7e+22)
t_1
(if (<= z 1.1e+30) (+ x (/ (* y (- t x)) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - a) / z), (x - t), t);
double tmp;
if (z <= -7e+22) {
tmp = t_1;
} else if (z <= 1.1e+30) {
tmp = x + ((y * (t - x)) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - a) / z), Float64(x - t), t) tmp = 0.0 if (z <= -7e+22) tmp = t_1; elseif (z <= 1.1e+30) tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -7e+22], t$95$1, If[LessEqual[z, 1.1e+30], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+30}:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7e22 or 1.1e30 < z Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
distribute-rgt-out--N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites53.4%
if -7e22 < z < 1.1e30Initial program 80.4%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6455.3
Applied rewrites55.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ (- y a) z) (- x t) t))) (if (<= z -6.6e+22) t_1 (if (<= z 250.0) (fma (- t x) (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - a) / z), (x - t), t);
double tmp;
if (z <= -6.6e+22) {
tmp = t_1;
} else if (z <= 250.0) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - a) / z), Float64(x - t), t) tmp = 0.0 if (z <= -6.6e+22) tmp = t_1; elseif (z <= 250.0) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -6.6e+22], t$95$1, If[LessEqual[z, 250.0], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 250:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.5999999999999996e22 or 250 < z Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
distribute-rgt-out--N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites53.4%
if -6.5999999999999996e22 < z < 250Initial program 80.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.8
Applied rewrites84.8%
Taylor expanded in z around 0
lower-/.f6448.8
Applied rewrites48.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- t (* (- t x) (/ y z))))) (if (<= z -7e+22) t_1 (if (<= z 250.0) (fma (- t x) (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((t - x) * (y / z));
double tmp;
if (z <= -7e+22) {
tmp = t_1;
} else if (z <= 250.0) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(t - x) * Float64(y / z))) tmp = 0.0 if (z <= -7e+22) tmp = t_1; elseif (z <= 250.0) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(t - x), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+22], t$95$1, If[LessEqual[z, 250.0], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \left(t - x\right) \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -7 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 250:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7e22 or 250 < z Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
Taylor expanded in y around inf
lower-/.f6449.1
Applied rewrites49.1%
if -7e22 < z < 250Initial program 80.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.8
Applied rewrites84.8%
Taylor expanded in z around 0
lower-/.f6448.8
Applied rewrites48.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- t (* t (/ (- y a) z))))) (if (<= z -8.8e+27) t_1 (if (<= z 9.4e+30) (fma (- t x) (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (t * ((y - a) / z));
double tmp;
if (z <= -8.8e+27) {
tmp = t_1;
} else if (z <= 9.4e+30) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(t * Float64(Float64(y - a) / z))) tmp = 0.0 if (z <= -8.8e+27) tmp = t_1; elseif (z <= 9.4e+30) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(t * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e+27], t$95$1, If[LessEqual[z, 9.4e+30], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - t \cdot \frac{y - a}{z}\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.4 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.7999999999999995e27 or 9.39999999999999979e30 < z Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6446.1
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6453.4
Applied rewrites53.4%
Taylor expanded in x around 0
Applied rewrites36.3%
if -8.7999999999999995e27 < z < 9.39999999999999979e30Initial program 80.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.8
Applied rewrites84.8%
Taylor expanded in z around 0
lower-/.f6448.8
Applied rewrites48.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- t x) (/ y a) x))) (if (<= a -3.8e+47) t_1 (if (<= a 6e-8) (* (- x t) (/ y (- z a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), (y / a), x);
double tmp;
if (a <= -3.8e+47) {
tmp = t_1;
} else if (a <= 6e-8) {
tmp = (x - t) * (y / (z - a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(y / a), x) tmp = 0.0 if (a <= -3.8e+47) tmp = t_1; elseif (a <= 6e-8) tmp = Float64(Float64(x - t) * Float64(y / Float64(z - a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.8e+47], t$95$1, If[LessEqual[a, 6e-8], N[(N[(x - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-8}:\\
\;\;\;\;\left(x - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.8000000000000003e47 or 5.99999999999999946e-8 < a Initial program 80.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.8
Applied rewrites84.8%
Taylor expanded in z around 0
lower-/.f6448.8
Applied rewrites48.8%
if -3.8000000000000003e47 < a < 5.99999999999999946e-8Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f6441.9
Applied rewrites41.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6443.4
Applied rewrites43.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e-23) (+ x t) (if (<= z 2.15e+68) (fma (- t x) (/ y a) x) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-23) {
tmp = x + t;
} else if (z <= 2.15e+68) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e-23) tmp = Float64(x + t); elseif (z <= 2.15e+68) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e-23], N[(x + t), $MachinePrecision], If[LessEqual[z, 2.15e+68], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-23}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+68}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.59999999999999988e-23 or 2.1500000000000001e68 < z Initial program 80.4%
Taylor expanded in z around inf
lower--.f6419.8
Applied rewrites19.8%
Taylor expanded in x around 0
Applied rewrites33.7%
if -1.59999999999999988e-23 < z < 2.1500000000000001e68Initial program 80.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.8
Applied rewrites84.8%
Taylor expanded in z around 0
lower-/.f6448.8
Applied rewrites48.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 (- INFINITY))
(/ (* y (- x t)) z)
(if (<= t_1 -1e-295)
(+ x t)
(if (<= t_1 0.0)
(/ (* x (- y a)) z)
(if (<= t_1 400000000.0)
(* y (/ t (- a z)))
(if (<= t_1 4e+301) (+ x t) (/ (* x y) (- z a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y * (x - t)) / z;
} else if (t_1 <= -1e-295) {
tmp = x + t;
} else if (t_1 <= 0.0) {
tmp = (x * (y - a)) / z;
} else if (t_1 <= 400000000.0) {
tmp = y * (t / (a - z));
} else if (t_1 <= 4e+301) {
tmp = x + t;
} else {
tmp = (x * y) / (z - a);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y * (x - t)) / z;
} else if (t_1 <= -1e-295) {
tmp = x + t;
} else if (t_1 <= 0.0) {
tmp = (x * (y - a)) / z;
} else if (t_1 <= 400000000.0) {
tmp = y * (t / (a - z));
} else if (t_1 <= 4e+301) {
tmp = x + t;
} else {
tmp = (x * y) / (z - a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -math.inf: tmp = (y * (x - t)) / z elif t_1 <= -1e-295: tmp = x + t elif t_1 <= 0.0: tmp = (x * (y - a)) / z elif t_1 <= 400000000.0: tmp = y * (t / (a - z)) elif t_1 <= 4e+301: tmp = x + t else: tmp = (x * y) / (z - a) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(x - t)) / z); elseif (t_1 <= -1e-295) tmp = Float64(x + t); elseif (t_1 <= 0.0) tmp = Float64(Float64(x * Float64(y - a)) / z); elseif (t_1 <= 400000000.0) tmp = Float64(y * Float64(t / Float64(a - z))); elseif (t_1 <= 4e+301) tmp = Float64(x + t); else tmp = Float64(Float64(x * y) / Float64(z - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -Inf) tmp = (y * (x - t)) / z; elseif (t_1 <= -1e-295) tmp = x + t; elseif (t_1 <= 0.0) tmp = (x * (y - a)) / z; elseif (t_1 <= 400000000.0) tmp = y * (t / (a - z)); elseif (t_1 <= 4e+301) tmp = x + t; else tmp = (x * y) / (z - a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, -1e-295], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 400000000.0], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+301], N[(x + t), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-295}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{elif}\;t\_1 \leq 400000000:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+301}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f6441.9
Applied rewrites41.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6423.8
Applied rewrites23.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000006e-295 or 4e8 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000021e301Initial program 80.4%
Taylor expanded in z around inf
lower--.f6419.8
Applied rewrites19.8%
Taylor expanded in x around 0
Applied rewrites33.7%
if -1.00000000000000006e-295 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
Taylor expanded in x around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6419.8
Applied rewrites19.8%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4e8Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6423.1
Applied rewrites23.1%
if 4.00000000000000021e301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f6441.9
Applied rewrites41.9%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.1
Applied rewrites21.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 (- INFINITY))
(/ (* y (- x t)) z)
(if (<= t_1 -1e-295)
(+ x t)
(if (<= t_1 1e-53)
(/ (* x (- y a)) z)
(if (<= t_1 400000000.0)
(/ (* t y) (- a z))
(if (<= t_1 4e+301) (+ x t) (/ (* x y) (- z a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y * (x - t)) / z;
} else if (t_1 <= -1e-295) {
tmp = x + t;
} else if (t_1 <= 1e-53) {
tmp = (x * (y - a)) / z;
} else if (t_1 <= 400000000.0) {
tmp = (t * y) / (a - z);
} else if (t_1 <= 4e+301) {
tmp = x + t;
} else {
tmp = (x * y) / (z - a);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y * (x - t)) / z;
} else if (t_1 <= -1e-295) {
tmp = x + t;
} else if (t_1 <= 1e-53) {
tmp = (x * (y - a)) / z;
} else if (t_1 <= 400000000.0) {
tmp = (t * y) / (a - z);
} else if (t_1 <= 4e+301) {
tmp = x + t;
} else {
tmp = (x * y) / (z - a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -math.inf: tmp = (y * (x - t)) / z elif t_1 <= -1e-295: tmp = x + t elif t_1 <= 1e-53: tmp = (x * (y - a)) / z elif t_1 <= 400000000.0: tmp = (t * y) / (a - z) elif t_1 <= 4e+301: tmp = x + t else: tmp = (x * y) / (z - a) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(x - t)) / z); elseif (t_1 <= -1e-295) tmp = Float64(x + t); elseif (t_1 <= 1e-53) tmp = Float64(Float64(x * Float64(y - a)) / z); elseif (t_1 <= 400000000.0) tmp = Float64(Float64(t * y) / Float64(a - z)); elseif (t_1 <= 4e+301) tmp = Float64(x + t); else tmp = Float64(Float64(x * y) / Float64(z - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -Inf) tmp = (y * (x - t)) / z; elseif (t_1 <= -1e-295) tmp = x + t; elseif (t_1 <= 1e-53) tmp = (x * (y - a)) / z; elseif (t_1 <= 400000000.0) tmp = (t * y) / (a - z); elseif (t_1 <= 4e+301) tmp = x + t; else tmp = (x * y) / (z - a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, -1e-295], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 1e-53], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 400000000.0], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+301], N[(x + t), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-295}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 10^{-53}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{elif}\;t\_1 \leq 400000000:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+301}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f6441.9
Applied rewrites41.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6423.8
Applied rewrites23.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000006e-295 or 4e8 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000021e301Initial program 80.4%
Taylor expanded in z around inf
lower--.f6419.8
Applied rewrites19.8%
Taylor expanded in x around 0
Applied rewrites33.7%
if -1.00000000000000006e-295 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000003e-53Initial program 80.4%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.1
Applied rewrites46.1%
Taylor expanded in x around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6419.8
Applied rewrites19.8%
if 1.00000000000000003e-53 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4e8Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
if 4.00000000000000021e301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f6441.9
Applied rewrites41.9%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.1
Applied rewrites21.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1e-31) (+ x t) (if (<= z 5.3e-25) (* y (/ (- t x) a)) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e-31) {
tmp = x + t;
} else if (z <= 5.3e-25) {
tmp = y * ((t - x) / a);
} else {
tmp = x + t;
}
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 <= (-1d-31)) then
tmp = x + t
else if (z <= 5.3d-25) then
tmp = y * ((t - x) / a)
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e-31) {
tmp = x + t;
} else if (z <= 5.3e-25) {
tmp = y * ((t - x) / a);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1e-31: tmp = x + t elif z <= 5.3e-25: tmp = y * ((t - x) / a) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e-31) tmp = Float64(x + t); elseif (z <= 5.3e-25) tmp = Float64(y * Float64(Float64(t - x) / a)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1e-31) tmp = x + t; elseif (z <= 5.3e-25) tmp = y * ((t - x) / a); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e-31], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.3e-25], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-31}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-25}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1e-31 or 5.2999999999999997e-25 < z Initial program 80.4%
Taylor expanded in z around inf
lower--.f6419.8
Applied rewrites19.8%
Taylor expanded in x around 0
Applied rewrites33.7%
if -1e-31 < z < 5.2999999999999997e-25Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6425.8
Applied rewrites25.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 (- INFINITY))
(/ (* y (- x t)) z)
(if (<= t_1 -1e-295)
(+ x t)
(if (<= t_1 1e-231)
(* y (/ x z))
(if (<= t_1 4e+301) (+ x t) (/ (* x y) (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y * (x - t)) / z;
} else if (t_1 <= -1e-295) {
tmp = x + t;
} else if (t_1 <= 1e-231) {
tmp = y * (x / z);
} else if (t_1 <= 4e+301) {
tmp = x + t;
} else {
tmp = (x * y) / (z - a);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y * (x - t)) / z;
} else if (t_1 <= -1e-295) {
tmp = x + t;
} else if (t_1 <= 1e-231) {
tmp = y * (x / z);
} else if (t_1 <= 4e+301) {
tmp = x + t;
} else {
tmp = (x * y) / (z - a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -math.inf: tmp = (y * (x - t)) / z elif t_1 <= -1e-295: tmp = x + t elif t_1 <= 1e-231: tmp = y * (x / z) elif t_1 <= 4e+301: tmp = x + t else: tmp = (x * y) / (z - a) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(x - t)) / z); elseif (t_1 <= -1e-295) tmp = Float64(x + t); elseif (t_1 <= 1e-231) tmp = Float64(y * Float64(x / z)); elseif (t_1 <= 4e+301) tmp = Float64(x + t); else tmp = Float64(Float64(x * y) / Float64(z - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -Inf) tmp = (y * (x - t)) / z; elseif (t_1 <= -1e-295) tmp = x + t; elseif (t_1 <= 1e-231) tmp = y * (x / z); elseif (t_1 <= 4e+301) tmp = x + t; else tmp = (x * y) / (z - a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, -1e-295], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 1e-231], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+301], N[(x + t), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-295}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 10^{-231}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+301}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z - a}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f6441.9
Applied rewrites41.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6423.8
Applied rewrites23.8%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000006e-295 or 9.9999999999999999e-232 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000021e301Initial program 80.4%
Taylor expanded in z around inf
lower--.f6419.8
Applied rewrites19.8%
Taylor expanded in x around 0
Applied rewrites33.7%
if -1.00000000000000006e-295 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999999e-232Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6425.6
Applied rewrites25.6%
Taylor expanded in x around inf
lower-/.f6417.8
Applied rewrites17.8%
if 4.00000000000000021e301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f6441.9
Applied rewrites41.9%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.1
Applied rewrites21.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.3e-139) (+ x t) (if (<= z 6.2e-25) (/ (* t y) (- a z)) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e-139) {
tmp = x + t;
} else if (z <= 6.2e-25) {
tmp = (t * y) / (a - z);
} else {
tmp = x + t;
}
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 <= (-3.3d-139)) then
tmp = x + t
else if (z <= 6.2d-25) then
tmp = (t * y) / (a - z)
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e-139) {
tmp = x + t;
} else if (z <= 6.2e-25) {
tmp = (t * y) / (a - z);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.3e-139: tmp = x + t elif z <= 6.2e-25: tmp = (t * y) / (a - z) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.3e-139) tmp = Float64(x + t); elseif (z <= 6.2e-25) tmp = Float64(Float64(t * y) / Float64(a - z)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.3e-139) tmp = x + t; elseif (z <= 6.2e-25) tmp = (t * y) / (a - z); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e-139], N[(x + t), $MachinePrecision], If[LessEqual[z, 6.2e-25], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-139}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-25}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.3e-139 or 6.19999999999999989e-25 < z Initial program 80.4%
Taylor expanded in z around inf
lower--.f6419.8
Applied rewrites19.8%
Taylor expanded in x around 0
Applied rewrites33.7%
if -3.3e-139 < z < 6.19999999999999989e-25Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6421.3
Applied rewrites21.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ x z)))) (if (<= y -1.04e+223) t_1 (if (<= y 1.2e+204) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x / z);
double tmp;
if (y <= -1.04e+223) {
tmp = t_1;
} else if (y <= 1.2e+204) {
tmp = x + t;
} 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 = y * (x / z)
if (y <= (-1.04d+223)) then
tmp = t_1
else if (y <= 1.2d+204) then
tmp = x + t
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 = y * (x / z);
double tmp;
if (y <= -1.04e+223) {
tmp = t_1;
} else if (y <= 1.2e+204) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (x / z) tmp = 0 if y <= -1.04e+223: tmp = t_1 elif y <= 1.2e+204: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(x / z)) tmp = 0.0 if (y <= -1.04e+223) tmp = t_1; elseif (y <= 1.2e+204) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (x / z); tmp = 0.0; if (y <= -1.04e+223) tmp = t_1; elseif (y <= 1.2e+204) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.04e+223], t$95$1, If[LessEqual[y, 1.2e+204], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{z}\\
\mathbf{if}\;y \leq -1.04 \cdot 10^{+223}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+204}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.04e223 or 1.2e204 < y Initial program 80.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.5
Applied rewrites41.5%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6425.6
Applied rewrites25.6%
Taylor expanded in x around inf
lower-/.f6417.8
Applied rewrites17.8%
if -1.04e223 < y < 1.2e204Initial program 80.4%
Taylor expanded in z around inf
lower--.f6419.8
Applied rewrites19.8%
Taylor expanded in x around 0
Applied rewrites33.7%
(FPCore (x y z t a) :precision binary64 (+ x t))
double code(double x, double y, double z, double t, double a) {
return x + t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 + t
end function
public static double code(double x, double y, double z, double t, double a) {
return x + t;
}
def code(x, y, z, t, a): return x + t
function code(x, y, z, t, a) return Float64(x + t) end
function tmp = code(x, y, z, t, a) tmp = x + t; end
code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
\begin{array}{l}
\\
x + t
\end{array}
Initial program 80.4%
Taylor expanded in z around inf
lower--.f6419.8
Applied rewrites19.8%
Taylor expanded in x around 0
Applied rewrites33.7%
herbie shell --seed 2025149
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))