
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- y (* (- y x) (/ (- z a) t)))))
(if (<= t -4.5e+150)
t_1
(if (<= t 1.15e+139) (fma (/ (- t z) (- t a)) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y - ((y - x) * ((z - a) / t));
double tmp;
if (t <= -4.5e+150) {
tmp = t_1;
} else if (t <= 1.15e+139) {
tmp = fma(((t - z) / (t - a)), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y - Float64(Float64(y - x) * Float64(Float64(z - a) / t))) tmp = 0.0 if (t <= -4.5e+150) tmp = t_1; elseif (t <= 1.15e+139) tmp = fma(Float64(Float64(t - z) / Float64(t - a)), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(N[(y - x), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+150], t$95$1, If[LessEqual[t, 1.15e+139], N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \left(y - x\right) \cdot \frac{z - a}{t}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+150}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+139}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{t - a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.5e150 or 1.15e139 < t Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.0
Applied rewrites46.0%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
frac-2negN/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6452.8
Applied rewrites52.8%
if -4.5e150 < t < 1.15e139Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t z) (- t a)) y x)))
(if (<= a -2.85e+29)
t_1
(if (<= a 4.3e+43) (- y (* (- y x) (/ (- z a) t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / (t - a)), y, x);
double tmp;
if (a <= -2.85e+29) {
tmp = t_1;
} else if (a <= 4.3e+43) {
tmp = y - ((y - x) * ((z - a) / t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / Float64(t - a)), y, x) tmp = 0.0 if (a <= -2.85e+29) tmp = t_1; elseif (a <= 4.3e+43) tmp = Float64(y - Float64(Float64(y - x) * Float64(Float64(z - a) / t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -2.85e+29], t$95$1, If[LessEqual[a, 4.3e+43], N[(y - N[(N[(y - x), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{t - a}, y, x\right)\\
\mathbf{if}\;a \leq -2.85 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.3 \cdot 10^{+43}:\\
\;\;\;\;y - \left(y - x\right) \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.85e29 or 4.3e43 < a Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in x around 0
Applied rewrites67.5%
if -2.85e29 < a < 4.3e43Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.0
Applied rewrites46.0%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
frac-2negN/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6452.8
Applied rewrites52.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.25e+55)
(* (/ (- x y) (- t a)) z)
(if (<= z 2.2e+198)
(fma (/ (- t z) (- t a)) y x)
(* (- x y) (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.25e+55) {
tmp = ((x - y) / (t - a)) * z;
} else if (z <= 2.2e+198) {
tmp = fma(((t - z) / (t - a)), y, x);
} else {
tmp = (x - y) * (z / (t - a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.25e+55) tmp = Float64(Float64(Float64(x - y) / Float64(t - a)) * z); elseif (z <= 2.2e+198) tmp = fma(Float64(Float64(t - z) / Float64(t - a)), y, x); else tmp = Float64(Float64(x - y) * Float64(z / Float64(t - a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.25e+55], N[(N[(N[(x - y), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 2.2e+198], N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+55}:\\
\;\;\;\;\frac{x - y}{t - a} \cdot z\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+198}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{t - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if z < -2.24999999999999999e55Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.3
Applied rewrites80.3%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.1
Applied rewrites38.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift--.f64N/A
sub-divN/A
lift-/.f64N/A
lift-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6442.4
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
lower-/.f6442.6
Applied rewrites42.6%
if -2.24999999999999999e55 < z < 2.2e198Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in x around 0
Applied rewrites67.5%
if 2.2e198 < z Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.3
Applied rewrites80.3%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.1
Applied rewrites38.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6443.5
Applied rewrites43.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.7e+83)
(* (/ (- x y) (- t a)) z)
(if (<= z -1.65e-78)
(* (/ (- z t) (- a t)) y)
(if (<= z 2.2e+140)
(fma (/ t (- t a)) (- y x) x)
(* (- x y) (/ z (- t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+83) {
tmp = ((x - y) / (t - a)) * z;
} else if (z <= -1.65e-78) {
tmp = ((z - t) / (a - t)) * y;
} else if (z <= 2.2e+140) {
tmp = fma((t / (t - a)), (y - x), x);
} else {
tmp = (x - y) * (z / (t - a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e+83) tmp = Float64(Float64(Float64(x - y) / Float64(t - a)) * z); elseif (z <= -1.65e-78) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); elseif (z <= 2.2e+140) tmp = fma(Float64(t / Float64(t - a)), Float64(y - x), x); else tmp = Float64(Float64(x - y) * Float64(z / Float64(t - a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+83], N[(N[(N[(x - y), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, -1.65e-78], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 2.2e+140], N[(N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+83}:\\
\;\;\;\;\frac{x - y}{t - a} \cdot z\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-78}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{t - a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if z < -3.7000000000000002e83Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.3
Applied rewrites80.3%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.1
Applied rewrites38.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift--.f64N/A
sub-divN/A
lift-/.f64N/A
lift-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6442.4
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lift--.f64N/A
lower-/.f6442.6
Applied rewrites42.6%
if -3.7000000000000002e83 < z < -1.64999999999999991e-78Initial program 68.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.1
Applied rewrites40.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6451.7
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6451.7
Applied rewrites51.7%
if -1.64999999999999991e-78 < z < 2.1999999999999998e140Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in z around 0
Applied rewrites46.7%
if 2.1999999999999998e140 < z Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.3
Applied rewrites80.3%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.1
Applied rewrites38.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6443.5
Applied rewrites43.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- z t) (- a t)) y)))
(if (<= y -0.065)
t_1
(if (<= y 1.4e-29) (fma (/ x (- t a)) (- z t) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) / (a - t)) * y;
double tmp;
if (y <= -0.065) {
tmp = t_1;
} else if (y <= 1.4e-29) {
tmp = fma((x / (t - a)), (z - t), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) / Float64(a - t)) * y) tmp = 0.0 if (y <= -0.065) tmp = t_1; elseif (y <= 1.4e-29) tmp = fma(Float64(x / Float64(t - a)), Float64(z - t), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -0.065], t$95$1, If[LessEqual[y, 1.4e-29], N[(N[(x / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t} \cdot y\\
\mathbf{if}\;y \leq -0.065:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t - a}, z - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -0.065000000000000002 or 1.4000000000000001e-29 < y Initial program 68.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.1
Applied rewrites40.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6451.7
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6451.7
Applied rewrites51.7%
if -0.065000000000000002 < y < 1.4000000000000001e-29Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.3
Applied rewrites80.3%
Taylor expanded in x around inf
lower-/.f64N/A
lower--.f6441.4
Applied rewrites41.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ z a) (- y x) x))) (if (<= a -2.7e+98) t_1 (if (<= a 8.5e+79) (* (/ (- z t) (- a t)) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((z / a), (y - x), x);
double tmp;
if (a <= -2.7e+98) {
tmp = t_1;
} else if (a <= 8.5e+79) {
tmp = ((z - t) / (a - t)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(z / a), Float64(y - x), x) tmp = 0.0 if (a <= -2.7e+98) tmp = t_1; elseif (a <= 8.5e+79) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.7e+98], t$95$1, If[LessEqual[a, 8.5e+79], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{if}\;a \leq -2.7 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{+79}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.7e98 or 8.4999999999999998e79 < a Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around 0
lower-/.f6449.4
Applied rewrites49.4%
if -2.7e98 < a < 8.4999999999999998e79Initial program 68.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.1
Applied rewrites40.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6451.7
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6451.7
Applied rewrites51.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ z a) (- y x) x))) (if (<= a -5e+97) t_1 (if (<= a 8.5e+79) (* (- z t) (/ y (- a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((z / a), (y - x), x);
double tmp;
if (a <= -5e+97) {
tmp = t_1;
} else if (a <= 8.5e+79) {
tmp = (z - t) * (y / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(z / a), Float64(y - x), x) tmp = 0.0 if (a <= -5e+97) tmp = t_1; elseif (a <= 8.5e+79) tmp = Float64(Float64(z - t) * Float64(y / Float64(a - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5e+97], t$95$1, If[LessEqual[a, 8.5e+79], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{if}\;a \leq -5 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{+79}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.99999999999999999e97 or 8.4999999999999998e79 < a Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around 0
lower-/.f6449.4
Applied rewrites49.4%
if -4.99999999999999999e97 < a < 8.4999999999999998e79Initial program 68.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.1
Applied rewrites40.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6446.5
Applied rewrites46.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ (- t z) t) y x))) (if (<= t -9.5e-57) t_1 (if (<= t 4e+14) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / t), y, x);
double tmp;
if (t <= -9.5e-57) {
tmp = t_1;
} else if (t <= 4e+14) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / t), y, x) tmp = 0.0 if (t <= -9.5e-57) tmp = t_1; elseif (t <= 4e+14) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t, -9.5e-57], t$95$1, If[LessEqual[t, 4e+14], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{t}, y, x\right)\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+14}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.5000000000000005e-57 or 4e14 < t Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6438.2
Applied rewrites38.2%
Taylor expanded in x around 0
Applied rewrites41.9%
if -9.5000000000000005e-57 < t < 4e14Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around 0
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 1.0 (- y x) x)))
(if (<= t -1.12e+149)
t_1
(if (<= t 9.8e+120) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(1.0, (y - x), x);
double tmp;
if (t <= -1.12e+149) {
tmp = t_1;
} else if (t <= 9.8e+120) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(1.0, Float64(y - x), x) tmp = 0.0 if (t <= -1.12e+149) tmp = t_1; elseif (t <= 9.8e+120) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -1.12e+149], t$95$1, If[LessEqual[t, 9.8e+120], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{if}\;t \leq -1.12 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{+120}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.11999999999999992e149 or 9.80000000000000021e120 < t Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around inf
Applied rewrites19.4%
if -1.11999999999999992e149 < t < 9.80000000000000021e120Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around 0
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.6e+54) (* z (/ (- x y) t)) (if (<= z 1.6e+158) (fma 1.0 (- y x) x) (/ (* z (- x y)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.6e+54) {
tmp = z * ((x - y) / t);
} else if (z <= 1.6e+158) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = (z * (x - y)) / t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.6e+54) tmp = Float64(z * Float64(Float64(x - y) / t)); elseif (z <= 1.6e+158) tmp = fma(1.0, Float64(y - x), x); else tmp = Float64(Float64(z * Float64(x - y)) / t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.6e+54], N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+158], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+54}:\\
\;\;\;\;z \cdot \frac{x - y}{t}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+158}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(x - y\right)}{t}\\
\end{array}
\end{array}
if z < -4.59999999999999988e54Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.3
Applied rewrites80.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6442.4
Applied rewrites42.4%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6425.5
Applied rewrites25.5%
if -4.59999999999999988e54 < z < 1.59999999999999997e158Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around inf
Applied rewrites19.4%
if 1.59999999999999997e158 < z Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.3
Applied rewrites80.3%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.1
Applied rewrites38.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6423.7
Applied rewrites23.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* z (- x y)) t))) (if (<= z -4.6e+54) t_1 (if (<= z 1.6e+158) (fma 1.0 (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * (x - y)) / t;
double tmp;
if (z <= -4.6e+54) {
tmp = t_1;
} else if (z <= 1.6e+158) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z * Float64(x - y)) / t) tmp = 0.0 if (z <= -4.6e+54) tmp = t_1; elseif (z <= 1.6e+158) tmp = fma(1.0, Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -4.6e+54], t$95$1, If[LessEqual[z, 1.6e+158], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(x - y\right)}{t}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+158}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.59999999999999988e54 or 1.59999999999999997e158 < z Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
mult-flip-revN/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.3
Applied rewrites80.3%
Taylor expanded in z around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.1
Applied rewrites38.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6423.7
Applied rewrites23.7%
if -4.59999999999999988e54 < z < 1.59999999999999997e158Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around inf
Applied rewrites19.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -7.3e-56) (/ (* y z) (- a t)) (if (<= y 9.5e-94) (/ (* x (- z a)) t) (fma 1.0 (- y x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -7.3e-56) {
tmp = (y * z) / (a - t);
} else if (y <= 9.5e-94) {
tmp = (x * (z - a)) / t;
} else {
tmp = fma(1.0, (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= -7.3e-56) tmp = Float64(Float64(y * z) / Float64(a - t)); elseif (y <= 9.5e-94) tmp = Float64(Float64(x * Float64(z - a)) / t); else tmp = fma(1.0, Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -7.3e-56], N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e-94], N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.3 \cdot 10^{-56}:\\
\;\;\;\;\frac{y \cdot z}{a - t}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-94}:\\
\;\;\;\;\frac{x \cdot \left(z - a\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\end{array}
\end{array}
if y < -7.30000000000000045e-56Initial program 68.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.1
Applied rewrites40.1%
Taylor expanded in z around inf
lower-*.f6421.6
Applied rewrites21.6%
if -7.30000000000000045e-56 < y < 9.4999999999999997e-94Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.0
Applied rewrites46.0%
Taylor expanded in x around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6419.8
Applied rewrites19.8%
if 9.4999999999999997e-94 < y Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around inf
Applied rewrites19.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma 1.0 (- y x) x))) (if (<= t -3.8e+80) t_1 (if (<= t 1.1e+23) (/ (* y z) (- a t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(1.0, (y - x), x);
double tmp;
if (t <= -3.8e+80) {
tmp = t_1;
} else if (t <= 1.1e+23) {
tmp = (y * z) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(1.0, Float64(y - x), x) tmp = 0.0 if (t <= -3.8e+80) tmp = t_1; elseif (t <= 1.1e+23) tmp = Float64(Float64(y * z) / Float64(a - t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -3.8e+80], t$95$1, If[LessEqual[t, 1.1e+23], N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+23}:\\
\;\;\;\;\frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.79999999999999997e80 or 1.10000000000000004e23 < t Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around inf
Applied rewrites19.4%
if -3.79999999999999997e80 < t < 1.10000000000000004e23Initial program 68.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.1
Applied rewrites40.1%
Taylor expanded in z around inf
lower-*.f6421.6
Applied rewrites21.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma 1.0 (- y x) x))) (if (<= t -1.6e+19) t_1 (if (<= t 26.5) (* (/ z a) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(1.0, (y - x), x);
double tmp;
if (t <= -1.6e+19) {
tmp = t_1;
} else if (t <= 26.5) {
tmp = (z / a) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(1.0, Float64(y - x), x) tmp = 0.0 if (t <= -1.6e+19) tmp = t_1; elseif (t <= 26.5) tmp = Float64(Float64(z / a) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -1.6e+19], t$95$1, If[LessEqual[t, 26.5], N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 26.5:\\
\;\;\;\;\frac{z}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.6e19 or 26.5 < t Initial program 68.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in t around inf
Applied rewrites19.4%
if -1.6e19 < t < 26.5Initial program 68.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.1
Applied rewrites40.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6417.1
Applied rewrites17.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6419.5
Applied rewrites19.5%
(FPCore (x y z t a) :precision binary64 (* (/ z a) y))
double code(double x, double y, double z, double t, double a) {
return (z / a) * y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (z / a) * y
end function
public static double code(double x, double y, double z, double t, double a) {
return (z / a) * y;
}
def code(x, y, z, t, a): return (z / a) * y
function code(x, y, z, t, a) return Float64(Float64(z / a) * y) end
function tmp = code(x, y, z, t, a) tmp = (z / a) * y; end
code[x_, y_, z_, t_, a_] := N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}
\\
\frac{z}{a} \cdot y
\end{array}
Initial program 68.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.1
Applied rewrites40.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6417.1
Applied rewrites17.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6419.5
Applied rewrites19.5%
(FPCore (x y z t a) :precision binary64 (* z (/ y a)))
double code(double x, double y, double z, double t, double a) {
return z * (y / a);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = z * (y / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return z * (y / a);
}
def code(x, y, z, t, a): return z * (y / a)
function code(x, y, z, t, a) return Float64(z * Float64(y / a)) end
function tmp = code(x, y, z, t, a) tmp = z * (y / a); end
code[x_, y_, z_, t_, a_] := N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \frac{y}{a}
\end{array}
Initial program 68.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.1
Applied rewrites40.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6417.1
Applied rewrites17.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.6
Applied rewrites18.6%
herbie shell --seed 2025155
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y x) (- z t)) (- a t))))