
(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 19 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 (/ (fma t -1.0 x) z) (- y a) t)))
(if (<= z -6e+120)
t_1
(if (<= z 6e+94) (- x (/ (- x t) (/ (- z a) (- z y)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((fma(t, -1.0, x) / z), (y - a), t);
double tmp;
if (z <= -6e+120) {
tmp = t_1;
} else if (z <= 6e+94) {
tmp = x - ((x - t) / ((z - a) / (z - y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(fma(t, -1.0, x) / z), Float64(y - a), t) tmp = 0.0 if (z <= -6e+120) tmp = t_1; elseif (z <= 6e+94) tmp = Float64(x - Float64(Float64(x - t) / Float64(Float64(z - a) / Float64(z - y)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t * -1.0 + x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -6e+120], t$95$1, If[LessEqual[z, 6e+94], N[(x - N[(N[(x - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{\mathsf{fma}\left(t, -1, x\right)}{z}, y - a, t\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+94}:\\
\;\;\;\;x - \frac{x - t}{\frac{z - a}{z - y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6e120 or 6.0000000000000001e94 < z Initial program 38.8%
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 rewrites90.9%
if -6e120 < z < 6.0000000000000001e94Initial program 86.4%
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6485.2
Applied rewrites85.2%
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-inN/A
lift--.f64N/A
lift-neg.f64N/A
sub-negN/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-*r/N/A
clear-numN/A
lift-/.f64N/A
un-div-invN/A
lower-/.f6495.1
Applied rewrites95.1%
Final simplification93.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ (* (- y z) t) (- z a))))
(t_2 (fma (/ (fma t -1.0 x) z) (- y a) t)))
(if (<= z -4.5e+96)
t_2
(if (<= z -4.6e-178)
t_1
(if (<= z 4e-135)
(fma (/ (- y z) a) (- t x) x)
(if (<= z 7e+80) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (((y - z) * t) / (z - a));
double t_2 = fma((fma(t, -1.0, x) / z), (y - a), t);
double tmp;
if (z <= -4.5e+96) {
tmp = t_2;
} else if (z <= -4.6e-178) {
tmp = t_1;
} else if (z <= 4e-135) {
tmp = fma(((y - z) / a), (t - x), x);
} else if (z <= 7e+80) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(Float64(y - z) * t) / Float64(z - a))) t_2 = fma(Float64(fma(t, -1.0, x) / z), Float64(y - a), t) tmp = 0.0 if (z <= -4.5e+96) tmp = t_2; elseif (z <= -4.6e-178) tmp = t_1; elseif (z <= 4e-135) tmp = fma(Float64(Float64(y - z) / a), Float64(t - x), x); elseif (z <= 7e+80) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t * -1.0 + x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -4.5e+96], t$95$2, If[LessEqual[z, -4.6e-178], t$95$1, If[LessEqual[z, 4e-135], N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 7e+80], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{\left(y - z\right) \cdot t}{z - a}\\
t_2 := \mathsf{fma}\left(\frac{\mathsf{fma}\left(t, -1, x\right)}{z}, y - a, t\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+96}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-178}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-135}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.49999999999999957e96 or 6.99999999999999987e80 < z Initial program 38.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 rewrites87.5%
if -4.49999999999999957e96 < z < -4.59999999999999989e-178 or 4.0000000000000002e-135 < z < 6.99999999999999987e80Initial program 88.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.5
Applied rewrites75.5%
if -4.59999999999999989e-178 < z < 4.0000000000000002e-135Initial program 89.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6492.5
Applied rewrites92.5%
Final simplification84.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ (* (- y z) t) (- z a)))))
(if (<= z -4.8e+96)
(fma (/ x z) (- y a) t)
(if (<= z -4.6e-178)
t_1
(if (<= z 4e-135)
(fma (/ (- y z) a) (- t x) x)
(if (<= z 4.8e+83) t_1 (fma y (/ (- x t) z) t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (((y - z) * t) / (z - a));
double tmp;
if (z <= -4.8e+96) {
tmp = fma((x / z), (y - a), t);
} else if (z <= -4.6e-178) {
tmp = t_1;
} else if (z <= 4e-135) {
tmp = fma(((y - z) / a), (t - x), x);
} else if (z <= 4.8e+83) {
tmp = t_1;
} else {
tmp = fma(y, ((x - t) / z), t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(Float64(y - z) * t) / Float64(z - a))) tmp = 0.0 if (z <= -4.8e+96) tmp = fma(Float64(x / z), Float64(y - a), t); elseif (z <= -4.6e-178) tmp = t_1; elseif (z <= 4e-135) tmp = fma(Float64(Float64(y - z) / a), Float64(t - x), x); elseif (z <= 4.8e+83) tmp = t_1; else tmp = fma(y, Float64(Float64(x - t) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+96], N[(N[(x / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, -4.6e-178], t$95$1, If[LessEqual[z, 4e-135], N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 4.8e+83], t$95$1, N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{\left(y - z\right) \cdot t}{z - a}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+96}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y - a, t\right)\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-178}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-135}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\end{array}
\end{array}
if z < -4.79999999999999986e96Initial program 35.8%
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 rewrites85.2%
Taylor expanded in t around 0
Applied rewrites79.4%
if -4.79999999999999986e96 < z < -4.59999999999999989e-178 or 4.0000000000000002e-135 < z < 4.79999999999999982e83Initial program 88.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.5
Applied rewrites75.5%
if -4.59999999999999989e-178 < z < 4.0000000000000002e-135Initial program 89.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6492.5
Applied rewrites92.5%
if 4.79999999999999982e83 < z Initial program 42.0%
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 rewrites89.7%
Taylor expanded in a around 0
Applied rewrites81.3%
Final simplification81.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) a) (- t x) x)))
(if (<= a -5e+50)
t_1
(if (<= a -5.8e-173)
(- t (/ (* (- x t) (- a y)) z))
(if (<= a 3e-109)
(fma y (/ (- x t) z) t)
(if (<= a 3.4e+28) (* (/ (- z y) (- z a)) t) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / a), (t - x), x);
double tmp;
if (a <= -5e+50) {
tmp = t_1;
} else if (a <= -5.8e-173) {
tmp = t - (((x - t) * (a - y)) / z);
} else if (a <= 3e-109) {
tmp = fma(y, ((x - t) / z), t);
} else if (a <= 3.4e+28) {
tmp = ((z - y) / (z - a)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / a), Float64(t - x), x) tmp = 0.0 if (a <= -5e+50) tmp = t_1; elseif (a <= -5.8e-173) tmp = Float64(t - Float64(Float64(Float64(x - t) * Float64(a - y)) / z)); elseif (a <= 3e-109) tmp = fma(y, Float64(Float64(x - t) / z), t); elseif (a <= 3.4e+28) tmp = Float64(Float64(Float64(z - y) / Float64(z - a)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5e+50], t$95$1, If[LessEqual[a, -5.8e-173], N[(t - N[(N[(N[(x - t), $MachinePrecision] * N[(a - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e-109], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[a, 3.4e+28], N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -5.8 \cdot 10^{-173}:\\
\;\;\;\;t - \frac{\left(x - t\right) \cdot \left(a - y\right)}{z}\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-109}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+28}:\\
\;\;\;\;\frac{z - y}{z - a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5e50 or 3.4e28 < a Initial program 68.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.8
Applied rewrites78.8%
if -5e50 < a < -5.7999999999999997e-173Initial program 83.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6488.1
Applied rewrites88.1%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites75.3%
if -5.7999999999999997e-173 < a < 3.00000000000000021e-109Initial program 64.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 rewrites94.9%
Taylor expanded in a around 0
Applied rewrites93.4%
if 3.00000000000000021e-109 < a < 3.4e28Initial program 70.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6481.3
Applied rewrites81.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6473.8
Applied rewrites73.8%
Final simplification81.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) a) (- t x) x)))
(if (<= a -5.3e+78)
t_1
(if (<= a 3e-109)
(fma y (/ (- x t) z) t)
(if (<= a 3.4e+28) (* (/ (- z y) (- z a)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / a), (t - x), x);
double tmp;
if (a <= -5.3e+78) {
tmp = t_1;
} else if (a <= 3e-109) {
tmp = fma(y, ((x - t) / z), t);
} else if (a <= 3.4e+28) {
tmp = ((z - y) / (z - a)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / a), Float64(t - x), x) tmp = 0.0 if (a <= -5.3e+78) tmp = t_1; elseif (a <= 3e-109) tmp = fma(y, Float64(Float64(x - t) / z), t); elseif (a <= 3.4e+28) tmp = Float64(Float64(Float64(z - y) / Float64(z - a)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.3e+78], t$95$1, If[LessEqual[a, 3e-109], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[a, 3.4e+28], N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -5.3 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-109}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+28}:\\
\;\;\;\;\frac{z - y}{z - a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.29999999999999961e78 or 3.4e28 < a Initial program 68.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.0
Applied rewrites80.0%
if -5.29999999999999961e78 < a < 3.00000000000000021e-109Initial program 72.4%
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 rewrites84.6%
Taylor expanded in a around 0
Applied rewrites80.6%
if 3.00000000000000021e-109 < a < 3.4e28Initial program 70.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6481.3
Applied rewrites81.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6473.8
Applied rewrites73.8%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ y a) x)))
(if (<= a -5.3e+78)
t_1
(if (<= a 3e-109)
(fma y (/ (- x t) z) t)
(if (<= a 3.4e+28) (* (/ (- z y) (- z a)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), (y / a), x);
double tmp;
if (a <= -5.3e+78) {
tmp = t_1;
} else if (a <= 3e-109) {
tmp = fma(y, ((x - t) / z), t);
} else if (a <= 3.4e+28) {
tmp = ((z - y) / (z - a)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(y / a), x) tmp = 0.0 if (a <= -5.3e+78) tmp = t_1; elseif (a <= 3e-109) tmp = fma(y, Float64(Float64(x - t) / z), t); elseif (a <= 3.4e+28) tmp = Float64(Float64(Float64(z - y) / Float64(z - a)) * 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[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.3e+78], t$95$1, If[LessEqual[a, 3e-109], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[a, 3.4e+28], N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -5.3 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-109}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+28}:\\
\;\;\;\;\frac{z - y}{z - a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.29999999999999961e78 or 3.4e28 < a Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6491.1
Applied rewrites91.1%
Taylor expanded in z around 0
lower-/.f6472.6
Applied rewrites72.6%
if -5.29999999999999961e78 < a < 3.00000000000000021e-109Initial program 72.4%
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 rewrites84.6%
Taylor expanded in a around 0
Applied rewrites80.6%
if 3.00000000000000021e-109 < a < 3.4e28Initial program 70.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6481.3
Applied rewrites81.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6473.8
Applied rewrites73.8%
Final simplification76.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ y a) x)))
(if (<= a -5.3e+78)
t_1
(if (<= a 2.45e-107)
(fma y (/ (- x t) z) t)
(if (<= a 3.35e+28) (* (- z y) (/ t (- z a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), (y / a), x);
double tmp;
if (a <= -5.3e+78) {
tmp = t_1;
} else if (a <= 2.45e-107) {
tmp = fma(y, ((x - t) / z), t);
} else if (a <= 3.35e+28) {
tmp = (z - y) * (t / (z - a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(y / a), x) tmp = 0.0 if (a <= -5.3e+78) tmp = t_1; elseif (a <= 2.45e-107) tmp = fma(y, Float64(Float64(x - t) / z), t); elseif (a <= 3.35e+28) tmp = Float64(Float64(z - y) * Float64(t / Float64(z - a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.3e+78], t$95$1, If[LessEqual[a, 2.45e-107], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[a, 3.35e+28], N[(N[(z - y), $MachinePrecision] * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -5.3 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.45 \cdot 10^{-107}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{elif}\;a \leq 3.35 \cdot 10^{+28}:\\
\;\;\;\;\left(z - y\right) \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.29999999999999961e78 or 3.35e28 < a Initial program 68.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6491.1
Applied rewrites91.1%
Taylor expanded in z around 0
lower-/.f6472.6
Applied rewrites72.6%
if -5.29999999999999961e78 < a < 2.4499999999999999e-107Initial program 72.0%
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 rewrites84.9%
Taylor expanded in a around 0
Applied rewrites80.9%
if 2.4499999999999999e-107 < a < 3.35e28Initial program 71.2%
Taylor expanded in t 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--.f6467.8
Applied rewrites67.8%
Final simplification75.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (fma t -1.0 x) z) (- y a) t)))
(if (<= z -6e+120)
t_1
(if (<= z 6e+94) (fma (- t x) (/ (- z y) (- z a)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((fma(t, -1.0, x) / z), (y - a), t);
double tmp;
if (z <= -6e+120) {
tmp = t_1;
} else if (z <= 6e+94) {
tmp = fma((t - x), ((z - y) / (z - a)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(fma(t, -1.0, x) / z), Float64(y - a), t) tmp = 0.0 if (z <= -6e+120) tmp = t_1; elseif (z <= 6e+94) tmp = fma(Float64(t - x), Float64(Float64(z - y) / Float64(z - a)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t * -1.0 + x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -6e+120], t$95$1, If[LessEqual[z, 6e+94], N[(N[(t - x), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{\mathsf{fma}\left(t, -1, x\right)}{z}, y - a, t\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{z - y}{z - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6e120 or 6.0000000000000001e94 < z Initial program 38.8%
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 rewrites90.9%
if -6e120 < z < 6.0000000000000001e94Initial program 86.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6494.9
Applied rewrites94.9%
Final simplification93.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.2e+87)
(fma (- x) (/ y a) x)
(if (<= a -1.56e-270)
(* (/ (- z y) z) t)
(if (<= a 6.5e+40) (fma y (/ x z) t) (fma y (/ t a) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.2e+87) {
tmp = fma(-x, (y / a), x);
} else if (a <= -1.56e-270) {
tmp = ((z - y) / z) * t;
} else if (a <= 6.5e+40) {
tmp = fma(y, (x / z), t);
} else {
tmp = fma(y, (t / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.2e+87) tmp = fma(Float64(-x), Float64(y / a), x); elseif (a <= -1.56e-270) tmp = Float64(Float64(Float64(z - y) / z) * t); elseif (a <= 6.5e+40) tmp = fma(y, Float64(x / z), t); else tmp = fma(y, Float64(t / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.2e+87], N[((-x) * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, -1.56e-270], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[a, 6.5e+40], N[(y * N[(x / z), $MachinePrecision] + t), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{y}{a}, x\right)\\
\mathbf{elif}\;a \leq -1.56 \cdot 10^{-270}:\\
\;\;\;\;\frac{z - y}{z} \cdot t\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\end{array}
\end{array}
if a < -2.2000000000000001e87Initial program 70.1%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6461.0
Applied rewrites61.0%
Taylor expanded in z around 0
Applied rewrites63.3%
if -2.2000000000000001e87 < a < -1.55999999999999999e-270Initial program 75.0%
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 rewrites79.2%
Taylor expanded in a around 0
Applied rewrites73.0%
Taylor expanded in t around inf
Applied rewrites63.2%
if -1.55999999999999999e-270 < a < 6.5000000000000001e40Initial program 70.0%
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.1%
Taylor expanded in a around 0
Applied rewrites72.5%
Taylor expanded in t around 0
Applied rewrites61.8%
if 6.5000000000000001e40 < a Initial program 65.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6492.3
Applied rewrites92.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.1
Applied rewrites71.1%
Taylor expanded in t around inf
Applied rewrites63.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.2e+119)
t
(if (<= z -4.8e-176)
(* 1.0 x)
(if (<= z 9.8e-38) (* (/ y a) t) (if (<= z 6.5e+80) (* 1.0 x) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+119) {
tmp = t;
} else if (z <= -4.8e-176) {
tmp = 1.0 * x;
} else if (z <= 9.8e-38) {
tmp = (y / a) * t;
} else if (z <= 6.5e+80) {
tmp = 1.0 * x;
} else {
tmp = t;
}
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 (z <= (-2.2d+119)) then
tmp = t
else if (z <= (-4.8d-176)) then
tmp = 1.0d0 * x
else if (z <= 9.8d-38) then
tmp = (y / a) * t
else if (z <= 6.5d+80) then
tmp = 1.0d0 * x
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+119) {
tmp = t;
} else if (z <= -4.8e-176) {
tmp = 1.0 * x;
} else if (z <= 9.8e-38) {
tmp = (y / a) * t;
} else if (z <= 6.5e+80) {
tmp = 1.0 * x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.2e+119: tmp = t elif z <= -4.8e-176: tmp = 1.0 * x elif z <= 9.8e-38: tmp = (y / a) * t elif z <= 6.5e+80: tmp = 1.0 * x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.2e+119) tmp = t; elseif (z <= -4.8e-176) tmp = Float64(1.0 * x); elseif (z <= 9.8e-38) tmp = Float64(Float64(y / a) * t); elseif (z <= 6.5e+80) tmp = Float64(1.0 * x); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.2e+119) tmp = t; elseif (z <= -4.8e-176) tmp = 1.0 * x; elseif (z <= 9.8e-38) tmp = (y / a) * t; elseif (z <= 6.5e+80) tmp = 1.0 * x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.2e+119], t, If[LessEqual[z, -4.8e-176], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 9.8e-38], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 6.5e+80], N[(1.0 * x), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+119}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-176}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+80}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -2.2000000000000001e119 or 6.4999999999999998e80 < z Initial program 39.4%
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6438.4
Applied rewrites38.4%
Taylor expanded in z around inf
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
lower-+.f6454.9
Applied rewrites54.9%
if -2.2000000000000001e119 < z < -4.80000000000000012e-176 or 9.80000000000000078e-38 < z < 6.4999999999999998e80Initial program 82.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-/.f6477.8
Applied rewrites77.8%
Taylor expanded in a around inf
Applied rewrites34.6%
if -4.80000000000000012e-176 < z < 9.80000000000000078e-38Initial program 91.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6494.6
Applied rewrites94.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in z around 0
Applied rewrites45.0%
Final simplification45.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ y a) x)))
(if (<= a -5.3e+78)
t_1
(if (<= a 3700000000000.0) (fma y (/ (- x t) z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), (y / a), x);
double tmp;
if (a <= -5.3e+78) {
tmp = t_1;
} else if (a <= 3700000000000.0) {
tmp = fma(y, ((x - t) / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(y / a), x) tmp = 0.0 if (a <= -5.3e+78) tmp = t_1; elseif (a <= 3700000000000.0) tmp = fma(y, Float64(Float64(x - t) / 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[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.3e+78], t$95$1, If[LessEqual[a, 3700000000000.0], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -5.3 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3700000000000:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.29999999999999961e78 or 3.7e12 < a Initial program 69.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6491.4
Applied rewrites91.4%
Taylor expanded in z around 0
lower-/.f6472.4
Applied rewrites72.4%
if -5.29999999999999961e78 < a < 3.7e12Initial program 71.2%
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 rewrites78.7%
Taylor expanded in a around 0
Applied rewrites73.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) y x)))
(if (<= a -5.4e+78)
t_1
(if (<= a 3700000000000.0) (fma y (/ (- x t) z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), y, x);
double tmp;
if (a <= -5.4e+78) {
tmp = t_1;
} else if (a <= 3700000000000.0) {
tmp = fma(y, ((x - t) / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), y, x) tmp = 0.0 if (a <= -5.4e+78) tmp = t_1; elseif (a <= 3700000000000.0) tmp = fma(y, Float64(Float64(x - t) / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -5.4e+78], t$95$1, If[LessEqual[a, 3700000000000.0], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{if}\;a \leq -5.4 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3700000000000:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.40000000000000009e78 or 3.7e12 < a Initial program 69.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.7
Applied rewrites71.7%
if -5.40000000000000009e78 < a < 3.7e12Initial program 71.2%
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 rewrites78.7%
Taylor expanded in a around 0
Applied rewrites73.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.6e+78) (fma (- x) (/ y a) x) (if (<= a 7.4e+40) (fma y (/ (- x t) z) t) (fma y (/ t a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.6e+78) {
tmp = fma(-x, (y / a), x);
} else if (a <= 7.4e+40) {
tmp = fma(y, ((x - t) / z), t);
} else {
tmp = fma(y, (t / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.6e+78) tmp = fma(Float64(-x), Float64(y / a), x); elseif (a <= 7.4e+40) tmp = fma(y, Float64(Float64(x - t) / z), t); else tmp = fma(y, Float64(t / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.6e+78], N[((-x) * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 7.4e+40], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.6 \cdot 10^{+78}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{y}{a}, x\right)\\
\mathbf{elif}\;a \leq 7.4 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\end{array}
\end{array}
if a < -6.6e78Initial program 69.4%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.6
Applied rewrites60.6%
Taylor expanded in z around 0
Applied rewrites62.8%
if -6.6e78 < a < 7.4e40Initial program 72.5%
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 rewrites77.8%
Taylor expanded in a around 0
Applied rewrites73.0%
if 7.4e40 < a Initial program 65.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6492.3
Applied rewrites92.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.1
Applied rewrites71.1%
Taylor expanded in t around inf
Applied rewrites63.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.9e+120) (fma a (/ (- t x) z) t) (if (<= z 9e+82) (fma y (/ t a) x) (fma y (/ x z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+120) {
tmp = fma(a, ((t - x) / z), t);
} else if (z <= 9e+82) {
tmp = fma(y, (t / a), x);
} else {
tmp = fma(y, (x / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+120) tmp = fma(a, Float64(Float64(t - x) / z), t); elseif (z <= 9e+82) tmp = fma(y, Float64(t / a), x); else tmp = fma(y, Float64(x / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+120], N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 9e+82], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+120}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z}, t\right)\\
\end{array}
\end{array}
if z < -1.8999999999999999e120Initial program 37.2%
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 rewrites90.6%
Taylor expanded in a around 0
Applied rewrites74.6%
Taylor expanded in y around 0
Applied rewrites74.4%
if -1.8999999999999999e120 < z < 8.9999999999999993e82Initial program 86.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6494.9
Applied rewrites94.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.0
Applied rewrites66.0%
Taylor expanded in t around inf
Applied rewrites55.2%
if 8.9999999999999993e82 < z Initial program 42.0%
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 rewrites89.7%
Taylor expanded in a around 0
Applied rewrites81.3%
Taylor expanded in t around 0
Applied rewrites72.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ x z) t))) (if (<= z -1.12e+120) t_1 (if (<= z 9e+82) (fma y (/ t a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (x / z), t);
double tmp;
if (z <= -1.12e+120) {
tmp = t_1;
} else if (z <= 9e+82) {
tmp = fma(y, (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(x / z), t) tmp = 0.0 if (z <= -1.12e+120) tmp = t_1; elseif (z <= 9e+82) tmp = fma(y, Float64(t / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.12e+120], t$95$1, If[LessEqual[z, 9e+82], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{x}{z}, t\right)\\
\mathbf{if}\;z \leq -1.12 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.12000000000000005e120 or 8.9999999999999993e82 < z Initial program 39.8%
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 rewrites90.1%
Taylor expanded in a around 0
Applied rewrites78.2%
Taylor expanded in t around 0
Applied rewrites70.0%
if -1.12000000000000005e120 < z < 8.9999999999999993e82Initial program 86.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6494.9
Applied rewrites94.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.0
Applied rewrites66.0%
Taylor expanded in t around inf
Applied rewrites55.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.6e+101) (* 1.0 x) (if (<= a 3.7e+43) (fma y (/ x z) t) (* 1.0 x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.6e+101) {
tmp = 1.0 * x;
} else if (a <= 3.7e+43) {
tmp = fma(y, (x / z), t);
} else {
tmp = 1.0 * x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.6e+101) tmp = Float64(1.0 * x); elseif (a <= 3.7e+43) tmp = fma(y, Float64(x / z), t); else tmp = Float64(1.0 * x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.6e+101], N[(1.0 * x), $MachinePrecision], If[LessEqual[a, 3.7e+43], N[(y * N[(x / z), $MachinePrecision] + t), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+101}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{+43}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if a < -1.60000000000000003e101 or 3.7000000000000001e43 < a Initial program 67.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-/.f6473.6
Applied rewrites73.6%
Taylor expanded in a around inf
Applied rewrites48.8%
if -1.60000000000000003e101 < a < 3.7000000000000001e43Initial program 72.0%
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 rewrites75.7%
Taylor expanded in a around 0
Applied rewrites70.5%
Taylor expanded in t around 0
Applied rewrites55.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -7.6e+100) (* 1.0 x) (if (<= a 3.65e+43) t (* 1.0 x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.6e+100) {
tmp = 1.0 * x;
} else if (a <= 3.65e+43) {
tmp = t;
} else {
tmp = 1.0 * 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 <= (-7.6d+100)) then
tmp = 1.0d0 * x
else if (a <= 3.65d+43) then
tmp = t
else
tmp = 1.0d0 * 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 <= -7.6e+100) {
tmp = 1.0 * x;
} else if (a <= 3.65e+43) {
tmp = t;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.6e+100: tmp = 1.0 * x elif a <= 3.65e+43: tmp = t else: tmp = 1.0 * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.6e+100) tmp = Float64(1.0 * x); elseif (a <= 3.65e+43) tmp = t; else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -7.6e+100) tmp = 1.0 * x; elseif (a <= 3.65e+43) tmp = t; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.6e+100], N[(1.0 * x), $MachinePrecision], If[LessEqual[a, 3.65e+43], t, N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.6 \cdot 10^{+100}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;a \leq 3.65 \cdot 10^{+43}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if a < -7.59999999999999927e100 or 3.6499999999999998e43 < a Initial program 67.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-/.f6473.6
Applied rewrites73.6%
Taylor expanded in a around inf
Applied rewrites48.8%
if -7.59999999999999927e100 < a < 3.6499999999999998e43Initial program 72.0%
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6470.1
Applied rewrites70.1%
Taylor expanded in z around inf
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
lower-+.f6433.8
Applied rewrites33.8%
Final simplification39.3%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return t;
}
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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 70.4%
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6469.2
Applied rewrites69.2%
Taylor expanded in z around inf
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
lower-+.f6426.4
Applied rewrites26.4%
Final simplification26.4%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 70.4%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6438.1
Applied rewrites38.1%
Taylor expanded in z around inf
Applied rewrites2.7%
(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 2024249
(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))))