
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- y z) (- -1.0 (- t z))) a x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (-1.0 - (t - z))), a, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(-1.0 - Float64(t - z))), a, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(-1.0 - N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{-1 - \left(t - z\right)}, a, x\right)
\end{array}
Initial program 97.6%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (/ y (- -1.0 t)))) (t_2 (/ (- y z) (/ (+ (- t z) 1.0) a))))
(if (<= t_2 -1e+302)
t_1
(if (<= t_2 5e+162) (fma a (/ z (- 1.0 z)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * (y / (-1.0 - t));
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -1e+302) {
tmp = t_1;
} else if (t_2 <= 5e+162) {
tmp = fma(a, (z / (1.0 - z)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(a * Float64(y / Float64(-1.0 - t))) t_2 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_2 <= -1e+302) tmp = t_1; elseif (t_2 <= 5e+162) tmp = fma(a, Float64(z / Float64(1.0 - z)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+302], t$95$1, If[LessEqual[t$95$2, 5e+162], N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{y}{-1 - t}\\
t_2 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+162}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{1 - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -1.0000000000000001e302 or 4.9999999999999997e162 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 99.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in a around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
lower--.f6474.6
Applied rewrites74.6%
Taylor expanded in z around 0
Applied rewrites69.9%
if -1.0000000000000001e302 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 4.9999999999999997e162Initial program 97.3%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in t around 0
Applied rewrites73.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* a (/ y (- -1.0 t)))) (t_2 (/ (- y z) (/ (+ (- t z) 1.0) a)))) (if (<= t_2 -1e+302) t_1 (if (<= t_2 5e+162) (- x a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * (y / (-1.0 - t));
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -1e+302) {
tmp = t_1;
} else if (t_2 <= 5e+162) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_2
real(8) :: tmp
t_1 = a * (y / ((-1.0d0) - t))
t_2 = (y - z) / (((t - z) + 1.0d0) / a)
if (t_2 <= (-1d+302)) then
tmp = t_1
else if (t_2 <= 5d+162) then
tmp = x - a
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 = a * (y / (-1.0 - t));
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -1e+302) {
tmp = t_1;
} else if (t_2 <= 5e+162) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * (y / (-1.0 - t)) t_2 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_2 <= -1e+302: tmp = t_1 elif t_2 <= 5e+162: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * Float64(y / Float64(-1.0 - t))) t_2 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_2 <= -1e+302) tmp = t_1; elseif (t_2 <= 5e+162) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * (y / (-1.0 - t)); t_2 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_2 <= -1e+302) tmp = t_1; elseif (t_2 <= 5e+162) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+302], t$95$1, If[LessEqual[t$95$2, 5e+162], N[(x - a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{y}{-1 - t}\\
t_2 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+162}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -1.0000000000000001e302 or 4.9999999999999997e162 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 99.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in a around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
lower--.f6474.6
Applied rewrites74.6%
Taylor expanded in z around 0
Applied rewrites69.9%
if -1.0000000000000001e302 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 4.9999999999999997e162Initial program 97.3%
Taylor expanded in z around inf
lower--.f6466.7
Applied rewrites66.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y z) (/ (+ (- t z) 1.0) a))))
(if (<= t_1 -2e+306)
(* (/ y z) a)
(if (<= t_1 2e+158) (- x a) (* y (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_1 <= -2e+306) {
tmp = (y / z) * a;
} else if (t_1 <= 2e+158) {
tmp = x - a;
} else {
tmp = y * (a / z);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) / (((t - z) + 1.0d0) / a)
if (t_1 <= (-2d+306)) then
tmp = (y / z) * a
else if (t_1 <= 2d+158) then
tmp = x - a
else
tmp = y * (a / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_1 <= -2e+306) {
tmp = (y / z) * a;
} else if (t_1 <= 2e+158) {
tmp = x - a;
} else {
tmp = y * (a / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_1 <= -2e+306: tmp = (y / z) * a elif t_1 <= 2e+158: tmp = x - a else: tmp = y * (a / z) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_1 <= -2e+306) tmp = Float64(Float64(y / z) * a); elseif (t_1 <= 2e+158) tmp = Float64(x - a); else tmp = Float64(y * Float64(a / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_1 <= -2e+306) tmp = (y / z) * a; elseif (t_1 <= 2e+158) tmp = x - a; else tmp = y * (a / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+306], N[(N[(y / z), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t$95$1, 2e+158], N[(x - a), $MachinePrecision], N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+306}:\\
\;\;\;\;\frac{y}{z} \cdot a\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+158}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{a}{z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -2.00000000000000003e306Initial program 100.0%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
lower--.f6491.5
Applied rewrites91.5%
Taylor expanded in z around inf
Applied rewrites61.5%
Applied rewrites61.5%
if -2.00000000000000003e306 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 1.99999999999999991e158Initial program 97.3%
Taylor expanded in z around inf
lower--.f6466.8
Applied rewrites66.8%
if 1.99999999999999991e158 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 99.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
lower--.f6457.7
Applied rewrites57.7%
Applied rewrites79.8%
Taylor expanded in z around inf
Applied rewrites33.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y z) a)) (t_2 (/ (- y z) (/ (+ (- t z) 1.0) a)))) (if (<= t_2 -2e+306) t_1 (if (<= t_2 2e+158) (- x a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / z) * a;
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -2e+306) {
tmp = t_1;
} else if (t_2 <= 2e+158) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_2
real(8) :: tmp
t_1 = (y / z) * a
t_2 = (y - z) / (((t - z) + 1.0d0) / a)
if (t_2 <= (-2d+306)) then
tmp = t_1
else if (t_2 <= 2d+158) then
tmp = x - a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y / z) * a;
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -2e+306) {
tmp = t_1;
} else if (t_2 <= 2e+158) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / z) * a t_2 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_2 <= -2e+306: tmp = t_1 elif t_2 <= 2e+158: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / z) * a) t_2 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_2 <= -2e+306) tmp = t_1; elseif (t_2 <= 2e+158) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / z) * a; t_2 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_2 <= -2e+306) tmp = t_1; elseif (t_2 <= 2e+158) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+306], t$95$1, If[LessEqual[t$95$2, 2e+158], N[(x - a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot a\\
t_2 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+306}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+158}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -2.00000000000000003e306 or 1.99999999999999991e158 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 99.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
lower-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
lower--.f6467.4
Applied rewrites67.4%
Taylor expanded in z around inf
Applied rewrites33.7%
Applied rewrites41.6%
if -2.00000000000000003e306 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 1.99999999999999991e158Initial program 97.3%
Taylor expanded in z around inf
lower--.f6466.8
Applied rewrites66.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) (- -1.0 t)) a x)))
(if (<= t -1000000000000.0)
t_1
(if (<= t 4.5e+59) (fma (/ (- y z) (+ z -1.0)) a x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / (-1.0 - t)), a, x);
double tmp;
if (t <= -1000000000000.0) {
tmp = t_1;
} else if (t <= 4.5e+59) {
tmp = fma(((y - z) / (z + -1.0)), a, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / Float64(-1.0 - t)), a, x) tmp = 0.0 if (t <= -1000000000000.0) tmp = t_1; elseif (t <= 4.5e+59) tmp = fma(Float64(Float64(y - z) / Float64(z + -1.0)), a, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]}, If[LessEqual[t, -1000000000000.0], t$95$1, If[LessEqual[t, 4.5e+59], N[(N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{-1 - t}, a, x\right)\\
\mathbf{if}\;t \leq -1000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{z + -1}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1e12 or 4.49999999999999959e59 < t Initial program 97.3%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around 0
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
lower--.f6487.7
Applied rewrites87.7%
if -1e12 < t < 4.49999999999999959e59Initial program 97.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in t around 0
sub-negN/A
metadata-evalN/A
lower-+.f6498.9
Applied rewrites98.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1650000000000.0)
(fma z (/ a (+ t (- 1.0 z))) x)
(if (<= t 2e+60)
(fma (/ (- y z) (+ z -1.0)) a x)
(- x (* y (/ a (+ 1.0 t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1650000000000.0) {
tmp = fma(z, (a / (t + (1.0 - z))), x);
} else if (t <= 2e+60) {
tmp = fma(((y - z) / (z + -1.0)), a, x);
} else {
tmp = x - (y * (a / (1.0 + t)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1650000000000.0) tmp = fma(z, Float64(a / Float64(t + Float64(1.0 - z))), x); elseif (t <= 2e+60) tmp = fma(Float64(Float64(y - z) / Float64(z + -1.0)), a, x); else tmp = Float64(x - Float64(y * Float64(a / Float64(1.0 + t)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1650000000000.0], N[(z * N[(a / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 2e+60], N[(N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], N[(x - N[(y * N[(a / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1650000000000:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{a}{t + \left(1 - z\right)}, x\right)\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{z + -1}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{a}{1 + t}\\
\end{array}
\end{array}
if t < -1.65e12Initial program 96.9%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6482.5
Applied rewrites82.5%
Applied rewrites82.5%
if -1.65e12 < t < 1.9999999999999999e60Initial program 97.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in t around 0
sub-negN/A
metadata-evalN/A
lower-+.f6498.9
Applied rewrites98.9%
if 1.9999999999999999e60 < t Initial program 97.9%
Taylor expanded in z around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6485.8
Applied rewrites85.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (fma (/ a z) (- 1.0 y) a))))
(if (<= z -600000.0)
t_1
(if (<= z 3.7e+55) (fma (/ y (- -1.0 t)) a x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - fma((a / z), (1.0 - y), a);
double tmp;
if (z <= -600000.0) {
tmp = t_1;
} else if (z <= 3.7e+55) {
tmp = fma((y / (-1.0 - t)), a, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - fma(Float64(a / z), Float64(1.0 - y), a)) tmp = 0.0 if (z <= -600000.0) tmp = t_1; elseif (z <= 3.7e+55) tmp = fma(Float64(y / Float64(-1.0 - t)), a, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(a / z), $MachinePrecision] * N[(1.0 - y), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -600000.0], t$95$1, If[LessEqual[z, 3.7e+55], N[(N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \mathsf{fma}\left(\frac{a}{z}, 1 - y, a\right)\\
\mathbf{if}\;z \leq -600000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+55}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-1 - t}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6e5 or 3.7000000000000002e55 < z Initial program 97.5%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
Applied rewrites87.9%
Taylor expanded in t around 0
Applied rewrites89.6%
if -6e5 < z < 3.7000000000000002e55Initial program 97.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
lower--.f6489.1
Applied rewrites89.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ z (+ t (- 1.0 z))) x)))
(if (<= z -960000.0)
t_1
(if (<= z 3.5e+55) (fma (/ y (- -1.0 t)) a x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, (z / (t + (1.0 - z))), x);
double tmp;
if (z <= -960000.0) {
tmp = t_1;
} else if (z <= 3.5e+55) {
tmp = fma((y / (-1.0 - t)), a, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(z / Float64(t + Float64(1.0 - z))), x) tmp = 0.0 if (z <= -960000.0) tmp = t_1; elseif (z <= 3.5e+55) tmp = fma(Float64(y / Float64(-1.0 - t)), a, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(z / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -960000.0], t$95$1, If[LessEqual[z, 3.5e+55], N[(N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{z}{t + \left(1 - z\right)}, x\right)\\
\mathbf{if}\;z \leq -960000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+55}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-1 - t}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.6e5 or 3.5000000000000001e55 < z Initial program 97.5%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6487.4
Applied rewrites87.4%
if -9.6e5 < z < 3.5000000000000001e55Initial program 97.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
lower--.f6489.1
Applied rewrites89.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1020000.0) (fma a (/ z (- 1.0 z)) x) (if (<= z 1.1e+56) (fma (/ y (- -1.0 t)) a x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1020000.0) {
tmp = fma(a, (z / (1.0 - z)), x);
} else if (z <= 1.1e+56) {
tmp = fma((y / (-1.0 - t)), a, x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1020000.0) tmp = fma(a, Float64(z / Float64(1.0 - z)), x); elseif (z <= 1.1e+56) tmp = fma(Float64(y / Float64(-1.0 - t)), a, x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1020000.0], N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.1e+56], N[(N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1020000:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{1 - z}, x\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-1 - t}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.02e6Initial program 98.5%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6488.0
Applied rewrites88.0%
Taylor expanded in t around 0
Applied rewrites77.3%
if -1.02e6 < z < 1.10000000000000008e56Initial program 97.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
lower--.f6489.1
Applied rewrites89.1%
if 1.10000000000000008e56 < z Initial program 96.1%
Taylor expanded in z around inf
lower--.f6479.4
Applied rewrites79.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.65e+38) (- x a) (if (<= z 1.6e+148) (fma a (/ z (+ 1.0 t)) x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.65e+38) {
tmp = x - a;
} else if (z <= 1.6e+148) {
tmp = fma(a, (z / (1.0 + t)), x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.65e+38) tmp = Float64(x - a); elseif (z <= 1.6e+148) tmp = fma(a, Float64(z / Float64(1.0 + t)), x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.65e+38], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.6e+148], N[(a * N[(z / N[(1.0 + t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+38}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{1 + t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.65e38 or 1.6e148 < z Initial program 96.9%
Taylor expanded in z around inf
lower--.f6479.7
Applied rewrites79.7%
if -1.65e38 < z < 1.6e148Initial program 98.1%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6463.3
Applied rewrites63.3%
Taylor expanded in z around 0
Applied rewrites60.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.2e+75) (fma a (/ z t) x) (- x a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.2e+75) {
tmp = fma(a, (z / t), x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.2e+75) tmp = fma(a, Float64(z / t), x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.2e+75], N[(a * N[(z / t), $MachinePrecision] + x), $MachinePrecision], N[(x - a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if t < -1.2e75Initial program 96.0%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6483.5
Applied rewrites83.5%
Taylor expanded in t around inf
Applied rewrites77.2%
if -1.2e75 < t Initial program 98.0%
Taylor expanded in z around inf
lower--.f6460.5
Applied rewrites60.5%
(FPCore (x y z t a) :precision binary64 (- x a))
double code(double x, double y, double z, double t, double a) {
return x - a;
}
real(8) function code(x, y, z, t, a)
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 - a
end function
public static double code(double x, double y, double z, double t, double a) {
return x - a;
}
def code(x, y, z, t, a): return x - a
function code(x, y, z, t, a) return Float64(x - a) end
function tmp = code(x, y, z, t, a) tmp = x - a; end
code[x_, y_, z_, t_, a_] := N[(x - a), $MachinePrecision]
\begin{array}{l}
\\
x - a
\end{array}
Initial program 97.6%
Taylor expanded in z around inf
lower--.f6458.6
Applied rewrites58.6%
(FPCore (x y z t a) :precision binary64 (- a))
double code(double x, double y, double z, double t, double a) {
return -a;
}
real(8) function code(x, y, z, t, a)
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 = -a
end function
public static double code(double x, double y, double z, double t, double a) {
return -a;
}
def code(x, y, z, t, a): return -a
function code(x, y, z, t, a) return Float64(-a) end
function tmp = code(x, y, z, t, a) tmp = -a; end
code[x_, y_, z_, t_, a_] := (-a)
\begin{array}{l}
\\
-a
\end{array}
Initial program 97.6%
Taylor expanded in z around inf
lower--.f6458.6
Applied rewrites58.6%
Taylor expanded in x around 0
Applied rewrites15.6%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (((y - z) / ((t - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a): return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((y - z) / ((t - z) + 1.0)) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
\end{array}
herbie shell --seed 2024254
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))