
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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 - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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 - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- (- t x)) z) (- y a) t))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e-204)
t_2
(if (<= t_2 4e-308)
(- t (* (- x) (/ (- y a) z)))
(if (<= t_2 2e+307) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((-(t - x) / z), (y - a), t);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e-204) {
tmp = t_2;
} else if (t_2 <= 4e-308) {
tmp = t - (-x * ((y - a) / z));
} else if (t_2 <= 2e+307) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(-Float64(t - x)) / z), Float64(y - a), t) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e-204) tmp = t_2; elseif (t_2 <= 4e-308) tmp = Float64(t - Float64(Float64(-x) * Float64(Float64(y - a) / z))); elseif (t_2 <= 2e+307) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[((-N[(t - x), $MachinePrecision]) / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-204], t$95$2, If[LessEqual[t$95$2, 4e-308], N[(t - N[((-x) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+307], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-\left(t - x\right)}{z}, y - a, t\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-204}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-308}:\\
\;\;\;\;t - \left(-x\right) \cdot \frac{y - a}{z}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -inf.0 or 1.99999999999999997e307 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 42.7%
Taylor expanded in z 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 rewrites82.4%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -5.0000000000000002e-204 or 4.00000000000000013e-308 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 1.99999999999999997e307Initial program 97.2%
if -5.0000000000000002e-204 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 4.00000000000000013e-308Initial program 4.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f645.2
Applied rewrites5.2%
Taylor expanded in z around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6492.2
Applied rewrites92.2%
Taylor expanded in x around inf
Applied rewrites99.8%
Final simplification92.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- (- t x)) z) (- y a) t))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z))))
(t_3 (+ x (/ (* (- y z) t) (- a z)))))
(if (<= t_2 -5e+305)
t_1
(if (<= t_2 -5e-204)
t_3
(if (<= t_2 4e-308)
(- t (* (- x) (/ (- y a) z)))
(if (<= t_2 2e+307) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((-(t - x) / z), (y - a), t);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double t_3 = x + (((y - z) * t) / (a - z));
double tmp;
if (t_2 <= -5e+305) {
tmp = t_1;
} else if (t_2 <= -5e-204) {
tmp = t_3;
} else if (t_2 <= 4e-308) {
tmp = t - (-x * ((y - a) / z));
} else if (t_2 <= 2e+307) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(-Float64(t - x)) / z), Float64(y - a), t) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) t_3 = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) tmp = 0.0 if (t_2 <= -5e+305) tmp = t_1; elseif (t_2 <= -5e-204) tmp = t_3; elseif (t_2 <= 4e-308) tmp = Float64(t - Float64(Float64(-x) * Float64(Float64(y - a) / z))); elseif (t_2 <= 2e+307) tmp = t_3; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[((-N[(t - x), $MachinePrecision]) / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+305], t$95$1, If[LessEqual[t$95$2, -5e-204], t$95$3, If[LessEqual[t$95$2, 4e-308], N[(t - N[((-x) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+307], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-\left(t - x\right)}{z}, y - a, t\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
t_3 := x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+305}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-204}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-308}:\\
\;\;\;\;t - \left(-x\right) \cdot \frac{y - a}{z}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -5.00000000000000009e305 or 1.99999999999999997e307 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 43.3%
Taylor expanded in z 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 rewrites81.7%
if -5.00000000000000009e305 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -5.0000000000000002e-204 or 4.00000000000000013e-308 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 1.99999999999999997e307Initial program 97.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6483.1
Applied rewrites83.1%
if -5.0000000000000002e-204 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 4.00000000000000013e-308Initial program 4.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f645.2
Applied rewrites5.2%
Taylor expanded in z around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6492.2
Applied rewrites92.2%
Taylor expanded in x around inf
Applied rewrites99.8%
Final simplification84.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) (- a z)) (- y z) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -5e-204)
t_1
(if (<= t_2 4e-308)
(- t (* (- x) (/ (- y a) z)))
(if (<= t_2 5e-64) (+ x (/ (* (- y z) t) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / (a - z)), (y - z), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -5e-204) {
tmp = t_1;
} else if (t_2 <= 4e-308) {
tmp = t - (-x * ((y - a) / z));
} else if (t_2 <= 5e-64) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / Float64(a - z)), Float64(y - z), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -5e-204) tmp = t_1; elseif (t_2 <= 4e-308) tmp = Float64(t - Float64(Float64(-x) * Float64(Float64(y - a) / z))); elseif (t_2 <= 5e-64) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-204], t$95$1, If[LessEqual[t$95$2, 4e-308], N[(t - N[((-x) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-64], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-204}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-308}:\\
\;\;\;\;t - \left(-x\right) \cdot \frac{y - a}{z}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-64}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -5.0000000000000002e-204 or 5.00000000000000033e-64 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 73.8%
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%
if -5.0000000000000002e-204 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 4.00000000000000013e-308Initial program 4.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f645.2
Applied rewrites5.2%
Taylor expanded in z around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6492.2
Applied rewrites92.2%
Taylor expanded in x around inf
Applied rewrites99.8%
if 4.00000000000000013e-308 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 5.00000000000000033e-64Initial program 99.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6499.6
Applied rewrites99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- (- t x)) z) (- y a) t)))
(if (<= z -4.6e+20)
t_1
(if (<= z 2.3e-12)
(+ x (/ (* (- t x) y) (- a z)))
(if (<= z 2.5e+31) (+ x (* (/ (- y z) a) (- t x))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((-(t - x) / z), (y - a), t);
double tmp;
if (z <= -4.6e+20) {
tmp = t_1;
} else if (z <= 2.3e-12) {
tmp = x + (((t - x) * y) / (a - z));
} else if (z <= 2.5e+31) {
tmp = x + (((y - z) / a) * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(-Float64(t - x)) / z), Float64(y - a), t) tmp = 0.0 if (z <= -4.6e+20) tmp = t_1; elseif (z <= 2.3e-12) tmp = Float64(x + Float64(Float64(Float64(t - x) * y) / Float64(a - z))); elseif (z <= 2.5e+31) tmp = Float64(x + Float64(Float64(Float64(y - z) / a) * Float64(t - x))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[((-N[(t - x), $MachinePrecision]) / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -4.6e+20], t$95$1, If[LessEqual[z, 2.3e-12], N[(x + N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+31], N[(x + N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-\left(t - x\right)}{z}, y - a, t\right)\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-12}:\\
\;\;\;\;x + \frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+31}:\\
\;\;\;\;x + \frac{y - z}{a} \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.6e20 or 2.50000000000000013e31 < z Initial program 43.6%
Taylor expanded in z 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 rewrites81.8%
if -4.6e20 < z < 2.29999999999999989e-12Initial program 91.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6481.0
Applied rewrites81.0%
if 2.29999999999999989e-12 < z < 2.50000000000000013e31Initial program 69.6%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6499.7
Applied rewrites99.7%
Final simplification81.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -3.2e-22)
t_1
(if (<= a 3.6e-132)
(- t (/ (* (- t x) y) z))
(if (<= a 1.66e+102) (- t (* (/ (- x) z) (- y a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / a), x);
double tmp;
if (a <= -3.2e-22) {
tmp = t_1;
} else if (a <= 3.6e-132) {
tmp = t - (((t - x) * y) / z);
} else if (a <= 1.66e+102) {
tmp = t - ((-x / z) * (y - a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -3.2e-22) tmp = t_1; elseif (a <= 3.6e-132) tmp = Float64(t - Float64(Float64(Float64(t - x) * y) / z)); elseif (a <= 1.66e+102) tmp = Float64(t - Float64(Float64(Float64(-x) / z) * Float64(y - a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.2e-22], t$95$1, If[LessEqual[a, 3.6e-132], N[(t - N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.66e+102], N[(t - N[(N[((-x) / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -3.2 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{-132}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot y}{z}\\
\mathbf{elif}\;a \leq 1.66 \cdot 10^{+102}:\\
\;\;\;\;t - \frac{-x}{z} \cdot \left(y - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.19999999999999987e-22 or 1.66e102 < a Initial program 69.8%
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--.f6473.4
Applied rewrites73.4%
Applied rewrites75.4%
if -3.19999999999999987e-22 < a < 3.60000000000000007e-132Initial program 66.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6469.3
Applied rewrites69.3%
Taylor expanded in z around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.6
Applied rewrites85.6%
Taylor expanded in y around inf
Applied rewrites83.8%
if 3.60000000000000007e-132 < a < 1.66e102Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6474.5
Applied rewrites74.5%
Taylor expanded in z around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6464.6
Applied rewrites64.6%
Taylor expanded in x around inf
Applied rewrites62.8%
Final simplification76.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -3.2e-22)
t_1
(if (<= a 3.6e-132)
(- t (/ (* (- t x) y) z))
(if (<= a 1.66e+102) (- t (* (- x) (/ (- y a) z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / a), x);
double tmp;
if (a <= -3.2e-22) {
tmp = t_1;
} else if (a <= 3.6e-132) {
tmp = t - (((t - x) * y) / z);
} else if (a <= 1.66e+102) {
tmp = t - (-x * ((y - a) / z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -3.2e-22) tmp = t_1; elseif (a <= 3.6e-132) tmp = Float64(t - Float64(Float64(Float64(t - x) * y) / z)); elseif (a <= 1.66e+102) tmp = Float64(t - Float64(Float64(-x) * Float64(Float64(y - a) / z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.2e-22], t$95$1, If[LessEqual[a, 3.6e-132], N[(t - N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.66e+102], N[(t - N[((-x) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -3.2 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{-132}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot y}{z}\\
\mathbf{elif}\;a \leq 1.66 \cdot 10^{+102}:\\
\;\;\;\;t - \left(-x\right) \cdot \frac{y - a}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.19999999999999987e-22 or 1.66e102 < a Initial program 69.8%
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--.f6473.4
Applied rewrites73.4%
Applied rewrites75.4%
if -3.19999999999999987e-22 < a < 3.60000000000000007e-132Initial program 66.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6469.3
Applied rewrites69.3%
Taylor expanded in z around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.6
Applied rewrites85.6%
Taylor expanded in y around inf
Applied rewrites83.8%
if 3.60000000000000007e-132 < a < 1.66e102Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6474.5
Applied rewrites74.5%
Taylor expanded in z around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6464.6
Applied rewrites64.6%
Taylor expanded in x around inf
Applied rewrites62.8%
Final simplification76.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) a) x)))
(if (<= a -3.2e-22)
t_1
(if (<= a 2.35e-153)
(- t (/ (* (- t x) y) z))
(if (<= a 1.75e+102) (* (/ (- y z) (- a z)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / a), x);
double tmp;
if (a <= -3.2e-22) {
tmp = t_1;
} else if (a <= 2.35e-153) {
tmp = t - (((t - x) * y) / z);
} else if (a <= 1.75e+102) {
tmp = ((y - z) / (a - z)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -3.2e-22) tmp = t_1; elseif (a <= 2.35e-153) tmp = Float64(t - Float64(Float64(Float64(t - x) * y) / z)); elseif (a <= 1.75e+102) tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.2e-22], t$95$1, If[LessEqual[a, 2.35e-153], N[(t - N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.75e+102], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -3.2 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-153}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot y}{z}\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{+102}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.19999999999999987e-22 or 1.75000000000000005e102 < a Initial program 69.8%
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--.f6473.4
Applied rewrites73.4%
Applied rewrites75.4%
if -3.19999999999999987e-22 < a < 2.35e-153Initial program 64.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6468.2
Applied rewrites68.2%
Taylor expanded in z around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6486.0
Applied rewrites86.0%
Taylor expanded in y around inf
Applied rewrites84.0%
if 2.35e-153 < a < 1.75000000000000005e102Initial program 71.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
Taylor expanded in t around inf
*-commutativeN/A
Applied rewrites82.1%
Taylor expanded in x around 0
Applied rewrites63.3%
Final simplification76.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ t a) x)))
(if (<= a -1.28e+135)
t_1
(if (<= a 2.35e-153)
(- t (/ (* (- t x) y) z))
(if (<= a 4.1e+102) (* (/ (- y z) (- a z)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (t / a), x);
double tmp;
if (a <= -1.28e+135) {
tmp = t_1;
} else if (a <= 2.35e-153) {
tmp = t - (((t - x) * y) / z);
} else if (a <= 4.1e+102) {
tmp = ((y - z) / (a - z)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(t / a), x) tmp = 0.0 if (a <= -1.28e+135) tmp = t_1; elseif (a <= 2.35e-153) tmp = Float64(t - Float64(Float64(Float64(t - x) * y) / z)); elseif (a <= 4.1e+102) tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.28e+135], t$95$1, If[LessEqual[a, 2.35e-153], N[(t - N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.1e+102], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{if}\;a \leq -1.28 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-153}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot y}{z}\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{+102}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.28e135 or 4.1e102 < a Initial program 73.9%
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.1
Applied rewrites82.1%
Taylor expanded in x around 0
Applied rewrites79.2%
if -1.28e135 < a < 2.35e-153Initial program 63.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6470.0
Applied rewrites70.0%
Taylor expanded in z around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6481.6
Applied rewrites81.6%
Taylor expanded in y around inf
Applied rewrites76.4%
if 2.35e-153 < a < 4.1e102Initial program 71.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
Taylor expanded in t around inf
*-commutativeN/A
Applied rewrites82.1%
Taylor expanded in x around 0
Applied rewrites63.3%
Final simplification74.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- y z) (/ t (- a z)))))
(if (<= t -9.8e-47)
t_1
(if (<= t -1.45e-262)
(fma (- x) (/ y a) x)
(if (<= t 7.5e-40) (* (- t x) (/ y (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) * (t / (a - z));
double tmp;
if (t <= -9.8e-47) {
tmp = t_1;
} else if (t <= -1.45e-262) {
tmp = fma(-x, (y / a), x);
} else if (t <= 7.5e-40) {
tmp = (t - x) * (y / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) * Float64(t / Float64(a - z))) tmp = 0.0 if (t <= -9.8e-47) tmp = t_1; elseif (t <= -1.45e-262) tmp = fma(Float64(-x), Float64(y / a), x); elseif (t <= 7.5e-40) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.8e-47], t$95$1, If[LessEqual[t, -1.45e-262], N[((-x) * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 7.5e-40], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{if}\;t \leq -9.8 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-262}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{y}{a}, x\right)\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-40}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.800000000000001e-47 or 7.50000000000000069e-40 < t Initial program 68.2%
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%
if -9.800000000000001e-47 < t < -1.44999999999999998e-262Initial program 71.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6464.1
Applied rewrites64.1%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6458.2
Applied rewrites58.2%
Taylor expanded in z around 0
Applied rewrites51.9%
if -1.44999999999999998e-262 < t < 7.50000000000000069e-40Initial program 64.8%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6453.0
Applied rewrites53.0%
Final simplification64.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4.8e+48)
(fma (- y z) (/ t a) x)
(if (<= a -5.3e-197)
(* (- t x) (/ y (- a z)))
(if (<= a 1.75e-9) (* (- t) (/ (- y z) z)) (fma (/ (- t x) a) y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.8e+48) {
tmp = fma((y - z), (t / a), x);
} else if (a <= -5.3e-197) {
tmp = (t - x) * (y / (a - z));
} else if (a <= 1.75e-9) {
tmp = -t * ((y - z) / z);
} else {
tmp = fma(((t - x) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.8e+48) tmp = fma(Float64(y - z), Float64(t / a), x); elseif (a <= -5.3e-197) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); elseif (a <= 1.75e-9) tmp = Float64(Float64(-t) * Float64(Float64(y - z) / z)); else tmp = fma(Float64(Float64(t - x) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.8e+48], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, -5.3e-197], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.75e-9], N[((-t) * N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{elif}\;a \leq -5.3 \cdot 10^{-197}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-9}:\\
\;\;\;\;\left(-t\right) \cdot \frac{y - z}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\end{array}
\end{array}
if a < -4.8000000000000002e48Initial program 73.2%
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--.f6470.6
Applied rewrites70.6%
Taylor expanded in x around 0
Applied rewrites68.6%
if -4.8000000000000002e48 < a < -5.29999999999999972e-197Initial program 67.4%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.7
Applied rewrites60.7%
if -5.29999999999999972e-197 < a < 1.75e-9Initial 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-/.f6468.0
Applied rewrites68.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6463.6
Applied rewrites63.6%
Taylor expanded in t around inf
Applied rewrites41.2%
Taylor expanded in a around 0
Applied rewrites60.8%
if 1.75e-9 < a Initial program 66.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6463.6
Applied rewrites63.6%
Final simplification62.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y z) a)))
(if (<= a -1.28e+135)
(+ x (* t_1 (- t x)))
(if (<= a 1.66e+102)
(fma (/ (- (- t x)) z) (- y a) t)
(fma (- t x) t_1 x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / a;
double tmp;
if (a <= -1.28e+135) {
tmp = x + (t_1 * (t - x));
} else if (a <= 1.66e+102) {
tmp = fma((-(t - x) / z), (y - a), t);
} else {
tmp = fma((t - x), t_1, x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) / a) tmp = 0.0 if (a <= -1.28e+135) tmp = Float64(x + Float64(t_1 * Float64(t - x))); elseif (a <= 1.66e+102) tmp = fma(Float64(Float64(-Float64(t - x)) / z), Float64(y - a), t); else tmp = fma(Float64(t - x), t_1, x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -1.28e+135], N[(x + N[(t$95$1 * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.66e+102], N[(N[((-N[(t - x), $MachinePrecision]) / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * t$95$1 + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - z}{a}\\
\mathbf{if}\;a \leq -1.28 \cdot 10^{+135}:\\
\;\;\;\;x + t\_1 \cdot \left(t - x\right)\\
\mathbf{elif}\;a \leq 1.66 \cdot 10^{+102}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-\left(t - x\right)}{z}, y - a, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, t\_1, x\right)\\
\end{array}
\end{array}
if a < -1.28e135Initial program 78.7%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.0
Applied rewrites84.0%
if -1.28e135 < a < 1.66e102Initial program 65.9%
Taylor expanded in z 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 rewrites76.8%
if 1.66e102 < a Initial program 69.4%
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--.f6480.3
Applied rewrites80.3%
Applied rewrites85.9%
Final simplification78.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.28e+135)
(fma (- y z) (/ (- t x) a) x)
(if (<= a 1.66e+102)
(fma (/ (- (- t x)) z) (- y a) t)
(fma (- t x) (/ (- y z) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.28e+135) {
tmp = fma((y - z), ((t - x) / a), x);
} else if (a <= 1.66e+102) {
tmp = fma((-(t - x) / z), (y - a), t);
} else {
tmp = fma((t - x), ((y - z) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.28e+135) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); elseif (a <= 1.66e+102) tmp = fma(Float64(Float64(-Float64(t - x)) / z), Float64(y - a), t); else tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.28e+135], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.66e+102], N[(N[((-N[(t - x), $MachinePrecision]) / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.28 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;a \leq 1.66 \cdot 10^{+102}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-\left(t - x\right)}{z}, y - a, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\end{array}
\end{array}
if a < -1.28e135Initial program 78.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--.f6483.9
Applied rewrites83.9%
if -1.28e135 < a < 1.66e102Initial program 65.9%
Taylor expanded in z 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 rewrites76.8%
if 1.66e102 < a Initial program 69.4%
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--.f6480.3
Applied rewrites80.3%
Applied rewrites85.9%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.05e+156) (not (<= a 4.1e+102))) (fma (- y z) (/ t a) x) (* (/ (- y z) (- a z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.05e+156) || !(a <= 4.1e+102)) {
tmp = fma((y - z), (t / a), x);
} else {
tmp = ((y - z) / (a - z)) * t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.05e+156) || !(a <= 4.1e+102)) tmp = fma(Float64(y - z), Float64(t / a), x); else tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.05e+156], N[Not[LessEqual[a, 4.1e+102]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.05 \cdot 10^{+156} \lor \neg \left(a \leq 4.1 \cdot 10^{+102}\right):\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\end{array}
\end{array}
if a < -1.04999999999999991e156 or 4.1e102 < a Initial program 73.1%
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--.f6483.0
Applied rewrites83.0%
Taylor expanded in x around 0
Applied rewrites80.1%
if -1.04999999999999991e156 < a < 4.1e102Initial program 66.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6471.6
Applied rewrites71.6%
Taylor expanded in t around inf
*-commutativeN/A
Applied rewrites77.5%
Taylor expanded in x around 0
Applied rewrites61.5%
Final simplification66.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e+25) (not (<= z 1.38e+104))) (* (- t) (/ z (- a z))) (fma (/ (- t x) a) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e+25) || !(z <= 1.38e+104)) {
tmp = -t * (z / (a - z));
} else {
tmp = fma(((t - x) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e+25) || !(z <= 1.38e+104)) tmp = Float64(Float64(-t) * Float64(z / Float64(a - z))); else tmp = fma(Float64(Float64(t - x) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e+25], N[Not[LessEqual[z, 1.38e+104]], $MachinePrecision]], N[((-t) * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+25} \lor \neg \left(z \leq 1.38 \cdot 10^{+104}\right):\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\end{array}
\end{array}
if z < -8.19999999999999933e25 or 1.38e104 < z Initial program 39.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6462.1
Applied rewrites62.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6454.8
Applied rewrites54.8%
Taylor expanded in t around inf
Applied rewrites32.9%
Taylor expanded in y around 0
Applied rewrites60.1%
if -8.19999999999999933e25 < z < 1.38e104Initial program 88.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6457.9
Applied rewrites57.9%
Final simplification58.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.6e-20) (fma (- y z) (/ t a) x) (if (<= a 1.75e-9) (* (- t) (/ (- y z) z)) (fma (/ (- t x) a) y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.6e-20) {
tmp = fma((y - z), (t / a), x);
} else if (a <= 1.75e-9) {
tmp = -t * ((y - z) / z);
} else {
tmp = fma(((t - x) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.6e-20) tmp = fma(Float64(y - z), Float64(t / a), x); elseif (a <= 1.75e-9) tmp = Float64(Float64(-t) * Float64(Float64(y - z) / z)); else tmp = fma(Float64(Float64(t - x) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.6e-20], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.75e-9], N[((-t) * N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.6 \cdot 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-9}:\\
\;\;\;\;\left(-t\right) \cdot \frac{y - z}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\end{array}
\end{array}
if a < -8.60000000000000022e-20Initial program 71.2%
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--.f6470.5
Applied rewrites70.5%
Taylor expanded in x around 0
Applied rewrites62.1%
if -8.60000000000000022e-20 < a < 1.75e-9Initial program 67.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6469.7
Applied rewrites69.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6464.5
Applied rewrites64.5%
Taylor expanded in t around inf
Applied rewrites41.8%
Taylor expanded in a around 0
Applied rewrites58.7%
if 1.75e-9 < a Initial program 66.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6463.6
Applied rewrites63.6%
Final simplification60.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e+38) (not (<= z 3.1e+105))) (* (/ t x) x) (fma (/ (- t x) a) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e+38) || !(z <= 3.1e+105)) {
tmp = (t / x) * x;
} else {
tmp = fma(((t - x) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e+38) || !(z <= 3.1e+105)) tmp = Float64(Float64(t / x) * x); else tmp = fma(Float64(Float64(t - x) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e+38], N[Not[LessEqual[z, 3.1e+105]], $MachinePrecision]], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+38} \lor \neg \left(z \leq 3.1 \cdot 10^{+105}\right):\\
\;\;\;\;\frac{t}{x} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\end{array}
\end{array}
if z < -1.5000000000000001e38 or 3.10000000000000004e105 < z Initial program 39.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6461.8
Applied rewrites61.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6455.2
Applied rewrites55.2%
Taylor expanded in z around inf
Applied rewrites47.4%
if -1.5000000000000001e38 < z < 3.10000000000000004e105Initial program 88.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6457.5
Applied rewrites57.5%
Final simplification53.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+26) (not (<= z 3.1e+105))) (* (/ t x) x) (fma (- y z) (/ t a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+26) || !(z <= 3.1e+105)) {
tmp = (t / x) * x;
} else {
tmp = fma((y - z), (t / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+26) || !(z <= 3.1e+105)) tmp = Float64(Float64(t / x) * x); else tmp = fma(Float64(y - z), Float64(t / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+26], N[Not[LessEqual[z, 3.1e+105]], $MachinePrecision]], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+26} \lor \neg \left(z \leq 3.1 \cdot 10^{+105}\right):\\
\;\;\;\;\frac{t}{x} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\end{array}
\end{array}
if z < -1.9000000000000001e26 or 3.10000000000000004e105 < z Initial program 39.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6462.1
Applied rewrites62.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6454.8
Applied rewrites54.8%
Taylor expanded in z around inf
Applied rewrites47.0%
if -1.9000000000000001e26 < z < 3.10000000000000004e105Initial 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--.f6462.5
Applied rewrites62.5%
Taylor expanded in x around 0
Applied rewrites51.2%
Final simplification49.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.9e+14) (not (<= z 2.65e+105))) (* (/ t x) x) (fma (- x) (/ y a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e+14) || !(z <= 2.65e+105)) {
tmp = (t / x) * x;
} else {
tmp = fma(-x, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.9e+14) || !(z <= 2.65e+105)) tmp = Float64(Float64(t / x) * x); else tmp = fma(Float64(-x), Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.9e+14], N[Not[LessEqual[z, 2.65e+105]], $MachinePrecision]], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision], N[((-x) * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+14} \lor \neg \left(z \leq 2.65 \cdot 10^{+105}\right):\\
\;\;\;\;\frac{t}{x} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if z < -3.9e14 or 2.6499999999999999e105 < z Initial program 40.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6462.5
Applied rewrites62.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6455.2
Applied rewrites55.2%
Taylor expanded in z around inf
Applied rewrites47.5%
if -3.9e14 < z < 2.6499999999999999e105Initial program 88.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6486.8
Applied rewrites86.8%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6453.3
Applied rewrites53.3%
Taylor expanded in z around 0
Applied rewrites45.6%
Final simplification46.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.6e+136) (not (<= a 2.7e+102))) (* 1.0 x) (* (/ t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.6e+136) || !(a <= 2.7e+102)) {
tmp = 1.0 * x;
} else {
tmp = (t / x) * x;
}
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) :: tmp
if ((a <= (-2.6d+136)) .or. (.not. (a <= 2.7d+102))) then
tmp = 1.0d0 * x
else
tmp = (t / x) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.6e+136) || !(a <= 2.7e+102)) {
tmp = 1.0 * x;
} else {
tmp = (t / x) * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.6e+136) or not (a <= 2.7e+102): tmp = 1.0 * x else: tmp = (t / x) * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.6e+136) || !(a <= 2.7e+102)) tmp = Float64(1.0 * x); else tmp = Float64(Float64(t / x) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.6e+136) || ~((a <= 2.7e+102))) tmp = 1.0 * x; else tmp = (t / x) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.6e+136], N[Not[LessEqual[a, 2.7e+102]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+136} \lor \neg \left(a \leq 2.7 \cdot 10^{+102}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{x} \cdot x\\
\end{array}
\end{array}
if a < -2.6000000000000001e136 or 2.7000000000000001e102 < a Initial program 73.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6489.8
Applied rewrites89.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6477.9
Applied rewrites77.9%
Taylor expanded in z around inf
Applied rewrites6.4%
Taylor expanded in a around inf
Applied rewrites60.4%
if -2.6000000000000001e136 < a < 2.7000000000000001e102Initial program 65.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6471.8
Applied rewrites71.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6466.4
Applied rewrites66.4%
Taylor expanded in z around inf
Applied rewrites36.9%
Final simplification42.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.6e+136) (fma x (/ z a) x) (if (<= a 2.7e+102) (* (/ t x) x) (* 1.0 x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.6e+136) {
tmp = fma(x, (z / a), x);
} else if (a <= 2.7e+102) {
tmp = (t / x) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.6e+136) tmp = fma(x, Float64(z / a), x); elseif (a <= 2.7e+102) tmp = Float64(Float64(t / x) * x); else tmp = Float64(1.0 * x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.6e+136], N[(x * N[(z / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 2.7e+102], N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+136}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{z}{a}, x\right)\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+102}:\\
\;\;\;\;\frac{t}{x} \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if a < -2.6000000000000001e136Initial program 78.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6487.9
Applied rewrites87.9%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6458.0
Applied rewrites58.0%
Taylor expanded in y around 0
Applied rewrites54.8%
Taylor expanded in z around 0
Applied rewrites54.9%
if -2.6000000000000001e136 < a < 2.7000000000000001e102Initial program 65.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6471.8
Applied rewrites71.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6466.4
Applied rewrites66.4%
Taylor expanded in z around inf
Applied rewrites36.9%
if 2.7000000000000001e102 < a Initial program 69.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6491.5
Applied rewrites91.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6485.7
Applied rewrites85.7%
Taylor expanded in z around inf
Applied rewrites6.1%
Taylor expanded in a around inf
Applied rewrites65.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.9e+135) (not (<= a 1.75e+102))) (* 1.0 x) (+ x (- t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.9e+135) || !(a <= 1.75e+102)) {
tmp = 1.0 * x;
} else {
tmp = x + (t - x);
}
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) :: tmp
if ((a <= (-1.9d+135)) .or. (.not. (a <= 1.75d+102))) then
tmp = 1.0d0 * x
else
tmp = x + (t - x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.9e+135) || !(a <= 1.75e+102)) {
tmp = 1.0 * x;
} else {
tmp = x + (t - x);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.9e+135) or not (a <= 1.75e+102): tmp = 1.0 * x else: tmp = x + (t - x) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.9e+135) || !(a <= 1.75e+102)) tmp = Float64(1.0 * x); else tmp = Float64(x + Float64(t - x)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.9e+135) || ~((a <= 1.75e+102))) tmp = 1.0 * x; else tmp = x + (t - x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.9e+135], N[Not[LessEqual[a, 1.75e+102]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+135} \lor \neg \left(a \leq 1.75 \cdot 10^{+102}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x + \left(t - x\right)\\
\end{array}
\end{array}
if a < -1.9000000000000001e135 or 1.75000000000000005e102 < a Initial program 73.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6489.8
Applied rewrites89.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6477.9
Applied rewrites77.9%
Taylor expanded in z around inf
Applied rewrites6.4%
Taylor expanded in a around inf
Applied rewrites60.4%
if -1.9000000000000001e135 < a < 1.75000000000000005e102Initial program 65.9%
Taylor expanded in z around inf
lower--.f6428.1
Applied rewrites28.1%
Final simplification36.4%
(FPCore (x y z t a) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a) {
return 1.0 * x;
}
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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a) {
return 1.0 * x;
}
def code(x, y, z, t, a): return 1.0 * x
function code(x, y, z, t, a) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 68.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.5
Applied rewrites76.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
+-commutativeN/A
times-fracN/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f6469.4
Applied rewrites69.4%
Taylor expanded in z around inf
Applied rewrites29.0%
Taylor expanded in a around inf
Applied rewrites22.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* (/ y z) (- t x)))))
(if (< z -1.2536131056095036e+188)
t_1
(if (< z 4.446702369113811e+64)
(+ x (/ (- y z) (/ (- a z) (- t x))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
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 = t - ((y / z) * (t - x))
if (z < (-1.2536131056095036d+188)) then
tmp = t_1
else if (z < 4.446702369113811d+64) then
tmp = x + ((y - z) / ((a - z) / (t - x)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((y / z) * (t - x)) tmp = 0 if z < -1.2536131056095036e+188: tmp = t_1 elif z < 4.446702369113811e+64: tmp = x + ((y - z) / ((a - z) / (t - x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x))) tmp = 0.0 if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((y / z) * (t - x)); tmp = 0.0; if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = x + ((y - z) / ((a - z) / (t - x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
\mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024320
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))
(+ x (/ (* (- y z) (- t x)) (- a z))))