
(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}
Sampling outcomes in binary64 precision:
Herbie found 21 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 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (or (<= t_1 -1e-264) (not (<= t_1 0.0)))
(fma (/ (- z t) (- a t)) (- y x) x)
(/ (fma (- z a) (fma -1.0 y x) (* t y)) t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -1e-264) || !(t_1 <= 0.0)) {
tmp = fma(((z - t) / (a - t)), (y - x), x);
} else {
tmp = fma((z - a), fma(-1.0, y, x), (t * y)) / t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -1e-264) || !(t_1 <= 0.0)) tmp = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x); else tmp = Float64(fma(Float64(z - a), fma(-1.0, y, x), Float64(t * y)) / t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-264], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(z - a), $MachinePrecision] * N[(-1.0 * y + x), $MachinePrecision] + N[(t * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-264} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z - a, \mathsf{fma}\left(-1, y, x\right), t \cdot y\right)}{t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1e-264 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 71.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6491.8
Applied rewrites91.8%
if -1e-264 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 3.9%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites94.2%
Taylor expanded in t around 0
Applied rewrites99.9%
Final simplification92.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (or (<= t_1 -1e-264) (not (<= t_1 0.0)))
(fma (/ (- z t) (- a t)) (- y x) x)
(+ (/ (* (- y x) (- z a)) (- t)) y))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -1e-264) || !(t_1 <= 0.0)) {
tmp = fma(((z - t) / (a - t)), (y - x), x);
} else {
tmp = (((y - x) * (z - a)) / -t) + y;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -1e-264) || !(t_1 <= 0.0)) tmp = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x); else tmp = Float64(Float64(Float64(Float64(y - x) * Float64(z - a)) / Float64(-t)) + y); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-264], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / (-t)), $MachinePrecision] + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-264} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot \left(z - a\right)}{-t} + y\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1e-264 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 71.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6491.8
Applied rewrites91.8%
if -1e-264 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 3.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f643.9
Applied rewrites3.9%
Taylor expanded in t around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
associate-*r*N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
Final simplification92.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (or (<= t_1 -1e-264) (not (<= t_1 0.0)))
(fma (/ (- z t) (- a t)) (- y x) x)
(fma (/ x t) (- z a) y))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -1e-264) || !(t_1 <= 0.0)) {
tmp = fma(((z - t) / (a - t)), (y - x), x);
} else {
tmp = fma((x / t), (z - a), y);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -1e-264) || !(t_1 <= 0.0)) tmp = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x); else tmp = fma(Float64(x / t), Float64(z - a), y); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-264], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-264} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1e-264 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 71.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6491.8
Applied rewrites91.8%
if -1e-264 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 3.9%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites94.2%
Taylor expanded in x around inf
Applied rewrites94.2%
Final simplification91.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x t) (- z a) y)))
(if (<= t -1.3e-17)
t_1
(if (<= t 3.45e-112)
(+ x (* (/ (- z t) a) (- y x)))
(if (<= t 9.2e+21)
(+ x (/ (* (- y x) z) (- a t)))
(if (<= t 4.8e+160) (* (- z t) (/ y (- a t))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / t), (z - a), y);
double tmp;
if (t <= -1.3e-17) {
tmp = t_1;
} else if (t <= 3.45e-112) {
tmp = x + (((z - t) / a) * (y - x));
} else if (t <= 9.2e+21) {
tmp = x + (((y - x) * z) / (a - t));
} else if (t <= 4.8e+160) {
tmp = (z - t) * (y / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / t), Float64(z - a), y) tmp = 0.0 if (t <= -1.3e-17) tmp = t_1; elseif (t <= 3.45e-112) tmp = Float64(x + Float64(Float64(Float64(z - t) / a) * Float64(y - x))); elseif (t <= 9.2e+21) tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / Float64(a - t))); elseif (t <= 4.8e+160) 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[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -1.3e-17], t$95$1, If[LessEqual[t, 3.45e-112], N[(x + N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e+21], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e+160], 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{x}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.45 \cdot 10^{-112}:\\
\;\;\;\;x + \frac{z - t}{a} \cdot \left(y - x\right)\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{+21}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{a - t}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+160}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.30000000000000002e-17 or 4.8000000000000003e160 < t Initial program 33.3%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites83.1%
Taylor expanded in x around inf
Applied rewrites81.8%
if -1.30000000000000002e-17 < t < 3.45000000000000009e-112Initial program 89.2%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6488.6
Applied rewrites88.6%
if 3.45000000000000009e-112 < t < 9.2e21Initial program 91.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6484.3
Applied rewrites84.3%
if 9.2e21 < t < 4.8000000000000003e160Initial program 55.3%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6472.9
Applied rewrites72.9%
Final simplification83.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x t) (- z a) y)))
(if (<= t -1.3e-17)
t_1
(if (<= t 1.7e-106)
(+ x (* (/ (- z t) a) (- y x)))
(if (<= t 1.35e+24)
(fma (- (- z t)) (/ x (- a t)) x)
(if (<= t 4.8e+160) (* (- z t) (/ y (- a t))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / t), (z - a), y);
double tmp;
if (t <= -1.3e-17) {
tmp = t_1;
} else if (t <= 1.7e-106) {
tmp = x + (((z - t) / a) * (y - x));
} else if (t <= 1.35e+24) {
tmp = fma(-(z - t), (x / (a - t)), x);
} else if (t <= 4.8e+160) {
tmp = (z - t) * (y / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / t), Float64(z - a), y) tmp = 0.0 if (t <= -1.3e-17) tmp = t_1; elseif (t <= 1.7e-106) tmp = Float64(x + Float64(Float64(Float64(z - t) / a) * Float64(y - x))); elseif (t <= 1.35e+24) tmp = fma(Float64(-Float64(z - t)), Float64(x / Float64(a - t)), x); elseif (t <= 4.8e+160) 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[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -1.3e-17], t$95$1, If[LessEqual[t, 1.7e-106], N[(x + N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+24], N[((-N[(z - t), $MachinePrecision]) * N[(x / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 4.8e+160], 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{x}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-106}:\\
\;\;\;\;x + \frac{z - t}{a} \cdot \left(y - x\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(-\left(z - t\right), \frac{x}{a - t}, x\right)\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+160}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.30000000000000002e-17 or 4.8000000000000003e160 < t Initial program 33.3%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites83.1%
Taylor expanded in x around inf
Applied rewrites81.8%
if -1.30000000000000002e-17 < t < 1.69999999999999991e-106Initial program 89.4%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6488.8
Applied rewrites88.8%
if 1.69999999999999991e-106 < t < 1.35e24Initial program 87.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6478.2
Applied rewrites78.2%
if 1.35e24 < t < 4.8000000000000003e160Initial program 56.9%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.0
Applied rewrites75.0%
Final simplification83.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x t) (- z a) y)))
(if (<= t -9.5e+62)
t_1
(if (<= t -8e-56)
(/ (* (- z t) y) (- a t))
(if (<= t 1.4e+24)
(fma (/ (- y x) a) z x)
(if (<= t 4.8e+160) (* (- z t) (/ y (- a t))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / t), (z - a), y);
double tmp;
if (t <= -9.5e+62) {
tmp = t_1;
} else if (t <= -8e-56) {
tmp = ((z - t) * y) / (a - t);
} else if (t <= 1.4e+24) {
tmp = fma(((y - x) / a), z, x);
} else if (t <= 4.8e+160) {
tmp = (z - t) * (y / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / t), Float64(z - a), y) tmp = 0.0 if (t <= -9.5e+62) tmp = t_1; elseif (t <= -8e-56) tmp = Float64(Float64(Float64(z - t) * y) / Float64(a - t)); elseif (t <= 1.4e+24) tmp = fma(Float64(Float64(y - x) / a), z, x); elseif (t <= 4.8e+160) 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[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -9.5e+62], t$95$1, If[LessEqual[t, -8e-56], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+24], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t, 4.8e+160], 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{x}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-56}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+160}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.5000000000000003e62 or 4.8000000000000003e160 < t Initial program 29.8%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites87.3%
Taylor expanded in x around inf
Applied rewrites87.3%
if -9.5000000000000003e62 < t < -8.0000000000000003e-56Initial program 69.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.7
Applied rewrites77.7%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6469.3
Applied rewrites69.3%
if -8.0000000000000003e-56 < t < 1.4000000000000001e24Initial program 89.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6481.0
Applied rewrites81.0%
if 1.4000000000000001e24 < t < 4.8000000000000003e160Initial program 56.9%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.0
Applied rewrites75.0%
Final simplification81.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- z t) (/ y (- a t)))) (t_2 (fma (/ x t) (- z a) y)))
(if (<= t -2.2e+63)
t_2
(if (<= t -7.6e-56)
t_1
(if (<= t 1.4e+24)
(fma (/ (- y x) a) z x)
(if (<= t 4.8e+160) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * (y / (a - t));
double t_2 = fma((x / t), (z - a), y);
double tmp;
if (t <= -2.2e+63) {
tmp = t_2;
} else if (t <= -7.6e-56) {
tmp = t_1;
} else if (t <= 1.4e+24) {
tmp = fma(((y - x) / a), z, x);
} else if (t <= 4.8e+160) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) * Float64(y / Float64(a - t))) t_2 = fma(Float64(x / t), Float64(z - a), y) tmp = 0.0 if (t <= -2.2e+63) tmp = t_2; elseif (t <= -7.6e-56) tmp = t_1; elseif (t <= 1.4e+24) tmp = fma(Float64(Float64(y - x) / a), z, x); elseif (t <= 4.8e+160) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -2.2e+63], t$95$2, If[LessEqual[t, -7.6e-56], t$95$1, If[LessEqual[t, 1.4e+24], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t, 4.8e+160], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot \frac{y}{a - t}\\
t_2 := \mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{+63}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -7.6 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.1999999999999999e63 or 4.8000000000000003e160 < t Initial program 29.8%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites87.3%
Taylor expanded in x around inf
Applied rewrites87.3%
if -2.1999999999999999e63 < t < -7.6000000000000004e-56 or 1.4000000000000001e24 < t < 4.8000000000000003e160Initial program 61.7%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6471.2
Applied rewrites71.2%
if -7.6000000000000004e-56 < t < 1.4000000000000001e24Initial program 89.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6481.0
Applied rewrites81.0%
Final simplification80.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (fma -1.0 y x) t) (- z a) y)))
(if (<= t -1.2e-17)
t_1
(if (<= t 3.45e-112)
(+ x (* (/ (- z t) a) (- y x)))
(if (<= t 7e+21) (+ x (/ (* (- y x) z) (- a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((fma(-1.0, y, x) / t), (z - a), y);
double tmp;
if (t <= -1.2e-17) {
tmp = t_1;
} else if (t <= 3.45e-112) {
tmp = x + (((z - t) / a) * (y - x));
} else if (t <= 7e+21) {
tmp = x + (((y - x) * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(fma(-1.0, y, x) / t), Float64(z - a), y) tmp = 0.0 if (t <= -1.2e-17) tmp = t_1; elseif (t <= 3.45e-112) tmp = Float64(x + Float64(Float64(Float64(z - t) / a) * Float64(y - x))); elseif (t <= 7e+21) tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / Float64(a - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(-1.0 * y + x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -1.2e-17], t$95$1, If[LessEqual[t, 3.45e-112], N[(x + N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e+21], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{\mathsf{fma}\left(-1, y, x\right)}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.45 \cdot 10^{-112}:\\
\;\;\;\;x + \frac{z - t}{a} \cdot \left(y - x\right)\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+21}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.19999999999999993e-17 or 7e21 < t Initial program 39.9%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites78.5%
if -1.19999999999999993e-17 < t < 3.45000000000000009e-112Initial program 89.2%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6488.6
Applied rewrites88.6%
if 3.45000000000000009e-112 < t < 7e21Initial program 91.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6484.3
Applied rewrites84.3%
Final simplification83.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 1.0 (- y x) x)))
(if (<= t -2.6e+67)
t_1
(if (<= t -1.56e-55)
(/ (* (- z t) y) a)
(if (<= t 7.8e-239)
(fma (/ y a) z x)
(if (<= t 5e+24) (fma (/ (- x) a) z 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 <= -2.6e+67) {
tmp = t_1;
} else if (t <= -1.56e-55) {
tmp = ((z - t) * y) / a;
} else if (t <= 7.8e-239) {
tmp = fma((y / a), z, x);
} else if (t <= 5e+24) {
tmp = fma((-x / a), z, 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 <= -2.6e+67) tmp = t_1; elseif (t <= -1.56e-55) tmp = Float64(Float64(Float64(z - t) * y) / a); elseif (t <= 7.8e-239) tmp = fma(Float64(y / a), z, x); elseif (t <= 5e+24) tmp = fma(Float64(Float64(-x) / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -2.6e+67], t$95$1, If[LessEqual[t, -1.56e-55], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 7.8e-239], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t, 5e+24], N[(N[((-x) / a), $MachinePrecision] * z + 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 -2.6 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.56 \cdot 10^{-55}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-239}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.6e67 or 5.00000000000000045e24 < t Initial program 38.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.0
Applied rewrites77.0%
Taylor expanded in t around inf
Applied rewrites50.1%
if -2.6e67 < t < -1.56e-55Initial program 67.7%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4
Applied rewrites52.4%
Taylor expanded in x around 0
Applied rewrites39.5%
if -1.56e-55 < t < 7.8e-239Initial program 89.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6485.8
Applied rewrites85.8%
Taylor expanded in x around 0
Applied rewrites74.3%
if 7.8e-239 < t < 5.00000000000000045e24Initial program 89.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.0
Applied rewrites76.0%
Taylor expanded in x around inf
Applied rewrites70.9%
Final simplification60.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 1.0 (- y x) x)))
(if (<= t -2.6e+67)
t_1
(if (<= t -1.56e-55)
(/ (* (- z t) y) a)
(if (<= t 7.2e-239)
(fma (/ y a) z x)
(if (<= t 5e+24) (fma (- x) (/ z a) 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 <= -2.6e+67) {
tmp = t_1;
} else if (t <= -1.56e-55) {
tmp = ((z - t) * y) / a;
} else if (t <= 7.2e-239) {
tmp = fma((y / a), z, x);
} else if (t <= 5e+24) {
tmp = fma(-x, (z / a), 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 <= -2.6e+67) tmp = t_1; elseif (t <= -1.56e-55) tmp = Float64(Float64(Float64(z - t) * y) / a); elseif (t <= 7.2e-239) tmp = fma(Float64(y / a), z, x); elseif (t <= 5e+24) tmp = fma(Float64(-x), Float64(z / a), 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, -2.6e+67], t$95$1, If[LessEqual[t, -1.56e-55], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 7.2e-239], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t, 5e+24], N[((-x) * N[(z / a), $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 -2.6 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.56 \cdot 10^{-55}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-239}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.6e67 or 5.00000000000000045e24 < t Initial program 38.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.0
Applied rewrites77.0%
Taylor expanded in t around inf
Applied rewrites50.1%
if -2.6e67 < t < -1.56e-55Initial program 67.7%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4
Applied rewrites52.4%
Taylor expanded in x around 0
Applied rewrites39.5%
if -1.56e-55 < t < 7.2000000000000002e-239Initial program 89.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6485.8
Applied rewrites85.8%
Taylor expanded in x around 0
Applied rewrites74.3%
if 7.2000000000000002e-239 < t < 5.00000000000000045e24Initial program 89.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.0
Applied rewrites76.0%
Taylor expanded in y around 0
Applied rewrites68.8%
Final simplification59.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x t) (- z a) y)))
(if (<= t -1.3e-17)
t_1
(if (<= t 1.4e+24)
(fma (- z t) (/ (- y x) a) x)
(if (<= t 4.8e+160) (* (- z t) (/ y (- a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / t), (z - a), y);
double tmp;
if (t <= -1.3e-17) {
tmp = t_1;
} else if (t <= 1.4e+24) {
tmp = fma((z - t), ((y - x) / a), x);
} else if (t <= 4.8e+160) {
tmp = (z - t) * (y / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / t), Float64(z - a), y) tmp = 0.0 if (t <= -1.3e-17) tmp = t_1; elseif (t <= 1.4e+24) tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), x); elseif (t <= 4.8e+160) 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[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -1.3e-17], t$95$1, If[LessEqual[t, 1.4e+24], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 4.8e+160], 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{x}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+160}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.30000000000000002e-17 or 4.8000000000000003e160 < t Initial program 33.3%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites83.1%
Taylor expanded in x around inf
Applied rewrites81.8%
if -1.30000000000000002e-17 < t < 1.4000000000000001e24Initial program 89.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6482.5
Applied rewrites82.5%
if 1.4000000000000001e24 < t < 4.8000000000000003e160Initial program 56.9%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.0
Applied rewrites75.0%
Final simplification81.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x t) (- z a) y)))
(if (<= t -1.2e-17)
t_1
(if (<= t 7.8e-239)
(fma (- z t) (/ y a) x)
(if (<= t 1.5e+23) (fma (/ (- x) a) z x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / t), (z - a), y);
double tmp;
if (t <= -1.2e-17) {
tmp = t_1;
} else if (t <= 7.8e-239) {
tmp = fma((z - t), (y / a), x);
} else if (t <= 1.5e+23) {
tmp = fma((-x / a), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / t), Float64(z - a), y) tmp = 0.0 if (t <= -1.2e-17) tmp = t_1; elseif (t <= 7.8e-239) tmp = fma(Float64(z - t), Float64(y / a), x); elseif (t <= 1.5e+23) tmp = fma(Float64(Float64(-x) / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -1.2e-17], t$95$1, If[LessEqual[t, 7.8e-239], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1.5e+23], N[(N[((-x) / a), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-239}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.19999999999999993e-17 or 1.5e23 < t Initial program 40.3%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites79.1%
Taylor expanded in x around inf
Applied rewrites71.6%
if -1.19999999999999993e-17 < t < 7.8e-239Initial program 88.6%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6485.7
Applied rewrites85.7%
Taylor expanded in x around 0
Applied rewrites74.1%
if 7.8e-239 < t < 1.5e23Initial program 89.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.0
Applied rewrites76.0%
Taylor expanded in x around inf
Applied rewrites70.9%
Final simplification72.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x t) (- z a) y)))
(if (<= t -1.56e-55)
t_1
(if (<= t 7.8e-239)
(fma (/ y a) z x)
(if (<= t 1.5e+23) (fma (/ (- x) a) z x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / t), (z - a), y);
double tmp;
if (t <= -1.56e-55) {
tmp = t_1;
} else if (t <= 7.8e-239) {
tmp = fma((y / a), z, x);
} else if (t <= 1.5e+23) {
tmp = fma((-x / a), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / t), Float64(z - a), y) tmp = 0.0 if (t <= -1.56e-55) tmp = t_1; elseif (t <= 7.8e-239) tmp = fma(Float64(y / a), z, x); elseif (t <= 1.5e+23) tmp = fma(Float64(Float64(-x) / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -1.56e-55], t$95$1, If[LessEqual[t, 7.8e-239], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t, 1.5e+23], N[(N[((-x) / a), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -1.56 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-239}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.56e-55 or 1.5e23 < t Initial program 43.9%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites74.0%
Taylor expanded in x around inf
Applied rewrites68.1%
if -1.56e-55 < t < 7.8e-239Initial program 89.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6485.8
Applied rewrites85.8%
Taylor expanded in x around 0
Applied rewrites74.3%
if 7.8e-239 < t < 1.5e23Initial program 89.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.0
Applied rewrites76.0%
Taylor expanded in x around inf
Applied rewrites70.9%
Final simplification70.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 1.0 (- y x) x)))
(if (<= t -2.6e+67)
t_1
(if (<= t -1.56e-55)
(/ (* (- z t) y) a)
(if (<= t 2.4e+93) (fma (/ y a) z 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 <= -2.6e+67) {
tmp = t_1;
} else if (t <= -1.56e-55) {
tmp = ((z - t) * y) / a;
} else if (t <= 2.4e+93) {
tmp = fma((y / a), z, 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 <= -2.6e+67) tmp = t_1; elseif (t <= -1.56e-55) tmp = Float64(Float64(Float64(z - t) * y) / a); elseif (t <= 2.4e+93) tmp = fma(Float64(y / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -2.6e+67], t$95$1, If[LessEqual[t, -1.56e-55], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 2.4e+93], N[(N[(y / a), $MachinePrecision] * z + 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 -2.6 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.56 \cdot 10^{-55}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.6e67 or 2.4000000000000001e93 < t Initial program 31.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in t around inf
Applied rewrites57.7%
if -2.6e67 < t < -1.56e-55Initial program 67.7%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6452.4
Applied rewrites52.4%
Taylor expanded in x around 0
Applied rewrites39.5%
if -1.56e-55 < t < 2.4000000000000001e93Initial program 86.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6473.5
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites55.4%
Final simplification54.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5e-13) (not (<= t 2e+25))) (fma (/ x t) (- z a) y) (fma (/ z a) (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5e-13) || !(t <= 2e+25)) {
tmp = fma((x / t), (z - a), y);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5e-13) || !(t <= 2e+25)) tmp = fma(Float64(x / t), Float64(z - a), y); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5e-13], N[Not[LessEqual[t, 2e+25]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-13} \lor \neg \left(t \leq 2 \cdot 10^{+25}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if t < -4.9999999999999999e-13 or 2.00000000000000018e25 < t Initial program 39.8%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites78.9%
Taylor expanded in x around inf
Applied rewrites72.2%
if -4.9999999999999999e-13 < t < 2.00000000000000018e25Initial program 89.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6494.9
Applied rewrites94.9%
Taylor expanded in t around 0
lower-/.f6478.1
Applied rewrites78.1%
Final simplification75.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.3e-17) (not (<= t 2e+25))) (fma (/ x t) (- z a) y) (fma (/ (- y x) a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.3e-17) || !(t <= 2e+25)) {
tmp = fma((x / t), (z - a), y);
} else {
tmp = fma(((y - x) / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.3e-17) || !(t <= 2e+25)) tmp = fma(Float64(x / t), Float64(z - a), y); else tmp = fma(Float64(Float64(y - x) / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.3e-17], N[Not[LessEqual[t, 2e+25]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-17} \lor \neg \left(t \leq 2 \cdot 10^{+25}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -1.30000000000000002e-17 or 2.00000000000000018e25 < t Initial program 39.8%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites78.9%
Taylor expanded in x around inf
Applied rewrites72.2%
if -1.30000000000000002e-17 < t < 2.00000000000000018e25Initial program 89.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6477.8
Applied rewrites77.8%
Final simplification75.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e+67) (not (<= t 2.4e+93))) (fma 1.0 (- y x) x) (fma (/ y a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e+67) || !(t <= 2.4e+93)) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = fma((y / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e+67) || !(t <= 2.4e+93)) tmp = fma(1.0, Float64(y - x), x); else tmp = fma(Float64(y / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e+67], N[Not[LessEqual[t, 2.4e+93]], $MachinePrecision]], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+67} \lor \neg \left(t \leq 2.4 \cdot 10^{+93}\right):\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -8.9999999999999997e67 or 2.4000000000000001e93 < t Initial program 31.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in t around inf
Applied rewrites57.7%
if -8.9999999999999997e67 < t < 2.4000000000000001e93Initial program 83.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.3
Applied rewrites67.3%
Taylor expanded in x around 0
Applied rewrites50.7%
Final simplification53.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.56e-55) (not (<= t 5e+24))) (fma 1.0 (- y x) x) (fma t (/ x a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.56e-55) || !(t <= 5e+24)) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = fma(t, (x / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.56e-55) || !(t <= 5e+24)) tmp = fma(1.0, Float64(y - x), x); else tmp = fma(t, Float64(x / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.56e-55], N[Not[LessEqual[t, 5e+24]], $MachinePrecision]], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(t * N[(x / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.56 \cdot 10^{-55} \lor \neg \left(t \leq 5 \cdot 10^{+24}\right):\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{x}{a}, x\right)\\
\end{array}
\end{array}
if t < -1.56e-55 or 5.00000000000000045e24 < t Initial program 43.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Taylor expanded in t around inf
Applied rewrites43.5%
if -1.56e-55 < t < 5.00000000000000045e24Initial program 89.6%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6484.0
Applied rewrites84.0%
Taylor expanded in y around 0
Applied rewrites65.5%
Taylor expanded in z around 0
Applied rewrites44.5%
Final simplification44.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.1e-43) (not (<= t 3.2e-91))) (fma 1.0 (- y x) x) (/ (* y z) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.1e-43) || !(t <= 3.2e-91)) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = (y * z) / a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.1e-43) || !(t <= 3.2e-91)) tmp = fma(1.0, Float64(y - x), x); else tmp = Float64(Float64(y * z) / a); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.1e-43], N[Not[LessEqual[t, 3.2e-91]], $MachinePrecision]], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-43} \lor \neg \left(t \leq 3.2 \cdot 10^{-91}\right):\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -3.0999999999999999e-43 or 3.19999999999999996e-91 < t Initial program 50.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6479.5
Applied rewrites79.5%
Taylor expanded in t around inf
Applied rewrites38.9%
if -3.0999999999999999e-43 < t < 3.19999999999999996e-91Initial program 89.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6483.8
Applied rewrites83.8%
Taylor expanded in x around 0
Applied rewrites27.2%
Final simplification34.1%
(FPCore (x y z t a) :precision binary64 (fma 1.0 (- y x) x))
double code(double x, double y, double z, double t, double a) {
return fma(1.0, (y - x), x);
}
function code(x, y, z, t, a) return fma(1.0, Float64(y - x), x) end
code[x_, y_, z_, t_, a_] := N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1, y - x, x\right)
\end{array}
Initial program 66.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.9
Applied rewrites85.9%
Taylor expanded in t around inf
Applied rewrites24.5%
(FPCore (x y z t a) :precision binary64 (fma 1.0 (- x) x))
double code(double x, double y, double z, double t, double a) {
return fma(1.0, -x, x);
}
function code(x, y, z, t, a) return fma(1.0, Float64(-x), x) end
code[x_, y_, z_, t_, a_] := N[(1.0 * (-x) + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1, -x, x\right)
\end{array}
Initial program 66.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.9
Applied rewrites85.9%
Taylor expanded in t around inf
Applied rewrites24.5%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f642.7
Applied rewrites2.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
(if (< a -1.6153062845442575e-142)
t_1
(if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - x) / 1.0d0) * ((z - t) / (a - t)))
if (a < (-1.6153062845442575d-142)) then
tmp = t_1
else if (a < 3.774403170083174d-182) then
tmp = y - ((z / t) * (y - x))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))) tmp = 0 if a < -1.6153062845442575e-142: tmp = t_1 elif a < 3.774403170083174e-182: tmp = y - ((z / t) * (y - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) / 1.0) * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))); tmp = 0.0; if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = y - ((z / t) * (y - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[a, -1.6153062845442575e-142], t$95$1, If[Less[a, 3.774403170083174e-182], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024352
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< a -646122513817703/4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 1887201585041587/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))