
(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 17 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) (/ (- y z) (- a z)) x))
(t_2 (+ (/ (* (- t x) (- y z)) (- a z)) x)))
(if (<= t_2 -2e-257)
t_1
(if (<= t_2 0.0) (fma (- x t) (/ 1.0 (/ z (- y a))) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / (a - z)), x);
double t_2 = (((t - x) * (y - z)) / (a - z)) + x;
double tmp;
if (t_2 <= -2e-257) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma((x - t), (1.0 / (z / (y - a))), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / Float64(a - z)), x) t_2 = Float64(Float64(Float64(Float64(t - x) * Float64(y - z)) / Float64(a - z)) + x) tmp = 0.0 if (t_2 <= -2e-257) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(x - t), Float64(1.0 / Float64(z / Float64(y - 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[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-257], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(x - t), $MachinePrecision] * N[(1.0 / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\
t_2 := \frac{\left(t - x\right) \cdot \left(y - z\right)}{a - z} + x\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{1}{\frac{z}{y - a}}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -2e-257 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 73.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6491.7
Applied rewrites91.7%
if -2e-257 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 3.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f643.4
Applied rewrites3.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.8%
Applied rewrites99.9%
Final simplification92.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- y z) (- a z)) x))
(t_2 (+ (/ (* (- t x) (- y z)) (- a z)) x)))
(if (<= t_2 -2e-257)
t_1
(if (<= t_2 0.0) (fma (- x t) (/ (- y 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 - z)), x);
double t_2 = (((t - x) * (y - z)) / (a - z)) + x;
double tmp;
if (t_2 <= -2e-257) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma((x - t), ((y - 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) / Float64(a - z)), x) t_2 = Float64(Float64(Float64(Float64(t - x) * Float64(y - z)) / Float64(a - z)) + x) tmp = 0.0 if (t_2 <= -2e-257) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(x - t), Float64(Float64(y - 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] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-257], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\
t_2 := \frac{\left(t - x\right) \cdot \left(y - z\right)}{a - z} + x\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -2e-257 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 73.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6491.7
Applied rewrites91.7%
if -2e-257 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 3.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f643.4
Applied rewrites3.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.8%
Final simplification92.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- t x) x)))
(if (<= z -4e+146)
t_1
(if (<= z -1.62)
(* (/ y z) (- x t))
(if (<= z -9.5e-247)
(fma (/ (- x t) a) z x)
(if (<= z 6.5e-84)
(* (/ (- t x) a) y)
(if (<= z 6.4e+133) (fma (- z) (/ t a) x) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (z <= -4e+146) {
tmp = t_1;
} else if (z <= -1.62) {
tmp = (y / z) * (x - t);
} else if (z <= -9.5e-247) {
tmp = fma(((x - t) / a), z, x);
} else if (z <= 6.5e-84) {
tmp = ((t - x) / a) * y;
} else if (z <= 6.4e+133) {
tmp = fma(-z, (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -4e+146) tmp = t_1; elseif (z <= -1.62) tmp = Float64(Float64(y / z) * Float64(x - t)); elseif (z <= -9.5e-247) tmp = fma(Float64(Float64(x - t) / a), z, x); elseif (z <= 6.5e-84) tmp = Float64(Float64(Float64(t - x) / a) * y); elseif (z <= 6.4e+133) tmp = fma(Float64(-z), Float64(t / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -4e+146], t$95$1, If[LessEqual[z, -1.62], N[(N[(y / z), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.5e-247], N[(N[(N[(x - t), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[z, 6.5e-84], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 6.4e+133], N[((-z) * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -4 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.62:\\
\;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-247}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{a}, z, x\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-84}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+133}:\\
\;\;\;\;\mathsf{fma}\left(-z, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.99999999999999973e146 or 6.39999999999999994e133 < z Initial program 35.4%
Taylor expanded in z around inf
lower--.f6447.9
Applied rewrites47.9%
if -3.99999999999999973e146 < z < -1.6200000000000001Initial program 62.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6477.4
Applied rewrites77.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites77.9%
Taylor expanded in y around inf
Applied rewrites51.7%
if -1.6200000000000001 < z < -9.49999999999999939e-247Initial program 73.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--.f6465.0
Applied rewrites65.0%
Taylor expanded in x around 0
Applied rewrites61.8%
Taylor expanded in y around 0
Applied rewrites55.9%
if -9.49999999999999939e-247 < z < 6.50000000000000022e-84Initial program 93.3%
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.4
Applied rewrites82.4%
Taylor expanded in y around inf
Applied rewrites68.2%
if 6.50000000000000022e-84 < z < 6.39999999999999994e133Initial program 80.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--.f6467.0
Applied rewrites67.0%
Taylor expanded in x around 0
Applied rewrites60.7%
Taylor expanded in y around 0
Applied rewrites45.7%
Final simplification54.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- z) (/ t a) x)) (t_2 (+ (- t x) x)))
(if (<= z -4e+146)
t_2
(if (<= z -1.45e-18)
(* (/ y z) (- x t))
(if (<= z -9.5e-247)
t_1
(if (<= z 6.5e-84)
(* (/ (- t x) a) y)
(if (<= z 6.4e+133) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-z, (t / a), x);
double t_2 = (t - x) + x;
double tmp;
if (z <= -4e+146) {
tmp = t_2;
} else if (z <= -1.45e-18) {
tmp = (y / z) * (x - t);
} else if (z <= -9.5e-247) {
tmp = t_1;
} else if (z <= 6.5e-84) {
tmp = ((t - x) / a) * y;
} else if (z <= 6.4e+133) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-z), Float64(t / a), x) t_2 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -4e+146) tmp = t_2; elseif (z <= -1.45e-18) tmp = Float64(Float64(y / z) * Float64(x - t)); elseif (z <= -9.5e-247) tmp = t_1; elseif (z <= 6.5e-84) tmp = Float64(Float64(Float64(t - x) / a) * y); elseif (z <= 6.4e+133) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-z) * N[(t / a), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -4e+146], t$95$2, If[LessEqual[z, -1.45e-18], N[(N[(y / z), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.5e-247], t$95$1, If[LessEqual[z, 6.5e-84], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 6.4e+133], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-z, \frac{t}{a}, x\right)\\
t_2 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -4 \cdot 10^{+146}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-18}:\\
\;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-247}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-84}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3.99999999999999973e146 or 6.39999999999999994e133 < z Initial program 35.4%
Taylor expanded in z around inf
lower--.f6447.9
Applied rewrites47.9%
if -3.99999999999999973e146 < z < -1.45e-18Initial program 65.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6479.5
Applied rewrites79.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites77.0%
Taylor expanded in y around inf
Applied rewrites53.1%
if -1.45e-18 < z < -9.49999999999999939e-247 or 6.50000000000000022e-84 < z < 6.39999999999999994e133Initial program 76.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6466.9
Applied rewrites66.9%
Taylor expanded in x around 0
Applied rewrites62.2%
Taylor expanded in y around 0
Applied rewrites49.9%
if -9.49999999999999939e-247 < z < 6.50000000000000022e-84Initial program 93.3%
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.4
Applied rewrites82.4%
Taylor expanded in y around inf
Applied rewrites68.2%
Final simplification54.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ t a) x)) (t_2 (fma (- t x) (/ a z) t)))
(if (<= z -4.7e+68)
t_2
(if (<= z -1.26e-120)
t_1
(if (<= z 1.16e-83)
(fma (/ (- t x) a) y x)
(if (<= z 6.4e+133) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (t / a), x);
double t_2 = fma((t - x), (a / z), t);
double tmp;
if (z <= -4.7e+68) {
tmp = t_2;
} else if (z <= -1.26e-120) {
tmp = t_1;
} else if (z <= 1.16e-83) {
tmp = fma(((t - x) / a), y, x);
} else if (z <= 6.4e+133) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(t / a), x) t_2 = fma(Float64(t - x), Float64(a / z), t) tmp = 0.0 if (z <= -4.7e+68) tmp = t_2; elseif (z <= -1.26e-120) tmp = t_1; elseif (z <= 1.16e-83) tmp = fma(Float64(Float64(t - x) / a), y, x); elseif (z <= 6.4e+133) tmp = t_1; else tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(t - x), $MachinePrecision] * N[(a / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -4.7e+68], t$95$2, If[LessEqual[z, -1.26e-120], t$95$1, If[LessEqual[z, 1.16e-83], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 6.4e+133], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
t_2 := \mathsf{fma}\left(t - x, \frac{a}{z}, t\right)\\
\mathbf{if}\;z \leq -4.7 \cdot 10^{+68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.26 \cdot 10^{-120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.6999999999999996e68 or 6.39999999999999994e133 < z Initial program 36.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6469.6
Applied rewrites69.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites82.8%
Taylor expanded in y around 0
Applied rewrites65.2%
if -4.6999999999999996e68 < z < -1.25999999999999992e-120 or 1.16000000000000008e-83 < z < 6.39999999999999994e133Initial program 79.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--.f6461.0
Applied rewrites61.0%
Taylor expanded in x around 0
Applied rewrites58.9%
if -1.25999999999999992e-120 < z < 1.16000000000000008e-83Initial program 86.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6477.5
Applied rewrites77.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- t x) x)))
(if (<= z -4e+146)
t_1
(if (<= z -1.5e-31)
(* (/ y z) (- x t))
(if (<= z 1.16e-83)
(fma (/ (- t x) a) y x)
(if (<= z 2.6e+138) (fma (- y z) (/ t a) x) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (z <= -4e+146) {
tmp = t_1;
} else if (z <= -1.5e-31) {
tmp = (y / z) * (x - t);
} else if (z <= 1.16e-83) {
tmp = fma(((t - x) / a), y, x);
} else if (z <= 2.6e+138) {
tmp = fma((y - z), (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -4e+146) tmp = t_1; elseif (z <= -1.5e-31) tmp = Float64(Float64(y / z) * Float64(x - t)); elseif (z <= 1.16e-83) tmp = fma(Float64(Float64(t - x) / a), y, x); elseif (z <= 2.6e+138) tmp = fma(Float64(y - z), Float64(t / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -4e+146], t$95$1, If[LessEqual[z, -1.5e-31], N[(N[(y / z), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.16e-83], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 2.6e+138], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -4 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-31}:\\
\;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+138}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.99999999999999973e146 or 2.6000000000000001e138 < z Initial program 35.4%
Taylor expanded in z around inf
lower--.f6447.9
Applied rewrites47.9%
if -3.99999999999999973e146 < z < -1.49999999999999991e-31Initial program 67.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6480.0
Applied rewrites80.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites74.9%
Taylor expanded in y around inf
Applied rewrites49.0%
if -1.49999999999999991e-31 < z < 1.16000000000000008e-83Initial program 83.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6473.5
Applied rewrites73.5%
if 1.16000000000000008e-83 < z < 2.6000000000000001e138Initial program 80.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--.f6467.0
Applied rewrites67.0%
Taylor expanded in x around 0
Applied rewrites60.7%
Final simplification60.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- z) (/ t a) x)) (t_2 (+ (- t x) x)))
(if (<= z -1.6e+117)
t_2
(if (<= z -9.5e-247)
t_1
(if (<= z 6.5e-84) (* (/ (- t x) a) y) (if (<= z 6.4e+133) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-z, (t / a), x);
double t_2 = (t - x) + x;
double tmp;
if (z <= -1.6e+117) {
tmp = t_2;
} else if (z <= -9.5e-247) {
tmp = t_1;
} else if (z <= 6.5e-84) {
tmp = ((t - x) / a) * y;
} else if (z <= 6.4e+133) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-z), Float64(t / a), x) t_2 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -1.6e+117) tmp = t_2; elseif (z <= -9.5e-247) tmp = t_1; elseif (z <= 6.5e-84) tmp = Float64(Float64(Float64(t - x) / a) * y); elseif (z <= 6.4e+133) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-z) * N[(t / a), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.6e+117], t$95$2, If[LessEqual[z, -9.5e-247], t$95$1, If[LessEqual[z, 6.5e-84], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 6.4e+133], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-z, \frac{t}{a}, x\right)\\
t_2 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+117}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-247}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-84}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.60000000000000002e117 or 6.39999999999999994e133 < z Initial program 35.6%
Taylor expanded in z around inf
lower--.f6445.6
Applied rewrites45.6%
if -1.60000000000000002e117 < z < -9.49999999999999939e-247 or 6.50000000000000022e-84 < z < 6.39999999999999994e133Initial program 75.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6458.8
Applied rewrites58.8%
Taylor expanded in x around 0
Applied rewrites56.7%
Taylor expanded in y around 0
Applied rewrites45.6%
if -9.49999999999999939e-247 < z < 6.50000000000000022e-84Initial program 93.3%
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.4
Applied rewrites82.4%
Taylor expanded in y around inf
Applied rewrites68.2%
Final simplification51.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- t x) x)))
(if (<= z -4e+146)
t_1
(if (<= z -2.65e-18)
(* (/ y z) (- x t))
(if (<= z 2.6e+138) (fma (- y z) (/ t a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (z <= -4e+146) {
tmp = t_1;
} else if (z <= -2.65e-18) {
tmp = (y / z) * (x - t);
} else if (z <= 2.6e+138) {
tmp = fma((y - z), (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -4e+146) tmp = t_1; elseif (z <= -2.65e-18) tmp = Float64(Float64(y / z) * Float64(x - t)); elseif (z <= 2.6e+138) tmp = fma(Float64(y - z), Float64(t / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -4e+146], t$95$1, If[LessEqual[z, -2.65e-18], N[(N[(y / z), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+138], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -4 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.65 \cdot 10^{-18}:\\
\;\;\;\;\frac{y}{z} \cdot \left(x - t\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+138}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.99999999999999973e146 or 2.6000000000000001e138 < z Initial program 35.4%
Taylor expanded in z around inf
lower--.f6447.9
Applied rewrites47.9%
if -3.99999999999999973e146 < z < -2.65000000000000015e-18Initial program 65.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6479.5
Applied rewrites79.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites77.0%
Taylor expanded in y around inf
Applied rewrites53.1%
if -2.65000000000000015e-18 < z < 2.6000000000000001e138Initial program 82.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--.f6473.0
Applied rewrites73.0%
Taylor expanded in x around 0
Applied rewrites60.8%
Final simplification56.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- t x) x)))
(if (<= z -2.5e+61)
t_1
(if (<= z -9.5e-247)
(fma (/ z a) x x)
(if (<= z 5.2e+17) (* (/ (- t x) a) y) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (z <= -2.5e+61) {
tmp = t_1;
} else if (z <= -9.5e-247) {
tmp = fma((z / a), x, x);
} else if (z <= 5.2e+17) {
tmp = ((t - x) / a) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -2.5e+61) tmp = t_1; elseif (z <= -9.5e-247) tmp = fma(Float64(z / a), x, x); elseif (z <= 5.2e+17) tmp = Float64(Float64(Float64(t - x) / a) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -2.5e+61], t$95$1, If[LessEqual[z, -9.5e-247], N[(N[(z / a), $MachinePrecision] * x + x), $MachinePrecision], If[LessEqual[z, 5.2e+17], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-247}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, x, x\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+17}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.50000000000000009e61 or 5.2e17 < z Initial program 44.1%
Taylor expanded in z around inf
lower--.f6438.1
Applied rewrites38.1%
if -2.50000000000000009e61 < z < -9.49999999999999939e-247Initial program 75.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--.f6459.5
Applied rewrites59.5%
Taylor expanded in x around 0
Applied rewrites59.6%
Taylor expanded in y around 0
Applied rewrites52.5%
Taylor expanded in x around inf
Applied rewrites40.2%
if -9.49999999999999939e-247 < z < 5.2e17Initial program 93.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--.f6481.1
Applied rewrites81.1%
Taylor expanded in y around inf
Applied rewrites60.2%
Final simplification45.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7.2e+51)
(fma (- y z) (/ (- t x) a) x)
(if (<= a 6.4e+19)
(fma (- x t) (/ (- y a) z) t)
(fma (- t x) (/ (- y z) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.2e+51) {
tmp = fma((y - z), ((t - x) / a), x);
} else if (a <= 6.4e+19) {
tmp = fma((x - t), ((y - a) / z), t);
} else {
tmp = fma((t - x), ((y - z) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.2e+51) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); elseif (a <= 6.4e+19) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), 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, -7.2e+51], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 6.4e+19], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $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 -7.2 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;a \leq 6.4 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\end{array}
\end{array}
if a < -7.20000000000000022e51Initial program 72.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--.f6479.4
Applied rewrites79.4%
if -7.20000000000000022e51 < a < 6.4e19Initial program 65.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6479.1
Applied rewrites79.1%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites78.0%
if 6.4e19 < a Initial program 68.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6489.3
Applied rewrites89.3%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6480.1
Applied rewrites80.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -7.2e+51)
t_1
(if (<= a 6.4e+19) (fma (- x t) (/ (- y a) z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / a), x);
double tmp;
if (a <= -7.2e+51) {
tmp = t_1;
} else if (a <= 6.4e+19) {
tmp = fma((x - t), ((y - a) / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -7.2e+51) tmp = t_1; elseif (a <= 6.4e+19) tmp = fma(Float64(x - t), Float64(Float64(y - 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[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -7.2e+51], t$95$1, If[LessEqual[a, 6.4e+19], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.4 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.20000000000000022e51 or 6.4e19 < a Initial program 70.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--.f6477.3
Applied rewrites77.3%
if -7.20000000000000022e51 < a < 6.4e19Initial program 65.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6479.1
Applied rewrites79.1%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites78.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y z) (/ (- t x) a) x))) (if (<= a -7.2e+51) t_1 (if (<= a 1.46e-18) (fma (- x t) (/ y z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / a), x);
double tmp;
if (a <= -7.2e+51) {
tmp = t_1;
} else if (a <= 1.46e-18) {
tmp = fma((x - t), (y / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -7.2e+51) tmp = t_1; elseif (a <= 1.46e-18) tmp = fma(Float64(x - t), Float64(y / 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[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -7.2e+51], t$95$1, If[LessEqual[a, 1.46e-18], N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.46 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.20000000000000022e51 or 1.4599999999999999e-18 < a Initial program 69.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--.f6474.8
Applied rewrites74.8%
if -7.20000000000000022e51 < a < 1.4599999999999999e-18Initial program 66.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6479.1
Applied rewrites79.1%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites79.4%
Taylor expanded in y around inf
Applied rewrites73.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- t x) x)))
(if (<= z -2.5e+61)
t_1
(if (<= z -9.5e-247)
(fma (/ z a) x x)
(if (<= z 52000000000.0) (* (/ y a) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (z <= -2.5e+61) {
tmp = t_1;
} else if (z <= -9.5e-247) {
tmp = fma((z / a), x, x);
} else if (z <= 52000000000.0) {
tmp = (y / a) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -2.5e+61) tmp = t_1; elseif (z <= -9.5e-247) tmp = fma(Float64(z / a), x, x); elseif (z <= 52000000000.0) tmp = Float64(Float64(y / 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] + x), $MachinePrecision]}, If[LessEqual[z, -2.5e+61], t$95$1, If[LessEqual[z, -9.5e-247], N[(N[(z / a), $MachinePrecision] * x + x), $MachinePrecision], If[LessEqual[z, 52000000000.0], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-247}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, x, x\right)\\
\mathbf{elif}\;z \leq 52000000000:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.50000000000000009e61 or 5.2e10 < z Initial program 45.2%
Taylor expanded in z around inf
lower--.f6437.4
Applied rewrites37.4%
if -2.50000000000000009e61 < z < -9.49999999999999939e-247Initial program 75.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--.f6459.5
Applied rewrites59.5%
Taylor expanded in x around 0
Applied rewrites59.6%
Taylor expanded in y around 0
Applied rewrites52.5%
Taylor expanded in x around inf
Applied rewrites40.2%
if -9.49999999999999939e-247 < z < 5.2e10Initial program 93.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6498.3
Applied rewrites98.3%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6453.0
Applied rewrites53.0%
Taylor expanded in z around 0
Applied rewrites43.3%
Final simplification39.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y z) (/ t a) x))) (if (<= a -8e+73) t_1 (if (<= a 9.5e+50) (fma (- x t) (/ y 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 <= -8e+73) {
tmp = t_1;
} else if (a <= 9.5e+50) {
tmp = fma((x - t), (y / 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 <= -8e+73) tmp = t_1; elseif (a <= 9.5e+50) tmp = fma(Float64(x - t), Float64(y / 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, -8e+73], t$95$1, If[LessEqual[a, 9.5e+50], N[(N[(x - t), $MachinePrecision] * N[(y / z), $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 -8 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{+50}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.99999999999999986e73 or 9.4999999999999993e50 < a Initial program 70.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--.f6480.3
Applied rewrites80.3%
Taylor expanded in x around 0
Applied rewrites74.9%
if -7.99999999999999986e73 < a < 9.4999999999999993e50Initial program 66.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6478.8
Applied rewrites78.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites75.5%
Taylor expanded in y around inf
Applied rewrites68.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (- t x) x))) (if (<= z -6e+46) t_1 (if (<= z 52000000000.0) (* (/ y a) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (z <= -6e+46) {
tmp = t_1;
} else if (z <= 52000000000.0) {
tmp = (y / a) * t;
} 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 - x) + x
if (z <= (-6d+46)) then
tmp = t_1
else if (z <= 52000000000.0d0) then
tmp = (y / a) * t
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 - x) + x;
double tmp;
if (z <= -6e+46) {
tmp = t_1;
} else if (z <= 52000000000.0) {
tmp = (y / a) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t - x) + x tmp = 0 if z <= -6e+46: tmp = t_1 elif z <= 52000000000.0: tmp = (y / a) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -6e+46) tmp = t_1; elseif (z <= 52000000000.0) tmp = Float64(Float64(y / a) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t - x) + x; tmp = 0.0; if (z <= -6e+46) tmp = t_1; elseif (z <= 52000000000.0) tmp = (y / a) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -6e+46], t$95$1, If[LessEqual[z, 52000000000.0], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -6 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 52000000000:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.00000000000000047e46 or 5.2e10 < z Initial program 46.6%
Taylor expanded in z around inf
lower--.f6436.6
Applied rewrites36.6%
if -6.00000000000000047e46 < z < 5.2e10Initial program 84.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6492.4
Applied rewrites92.4%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6448.2
Applied rewrites48.2%
Taylor expanded in z around 0
Applied rewrites33.3%
Final simplification34.7%
(FPCore (x y z t a) :precision binary64 (+ (- t x) x))
double code(double x, double y, double z, double t, double a) {
return (t - x) + 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 = (t - x) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (t - x) + x;
}
def code(x, y, z, t, a): return (t - x) + x
function code(x, y, z, t, a) return Float64(Float64(t - x) + x) end
function tmp = code(x, y, z, t, a) tmp = (t - x) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(t - x\right) + x
\end{array}
Initial program 67.8%
Taylor expanded in z around inf
lower--.f6419.0
Applied rewrites19.0%
Final simplification19.0%
(FPCore (x y z t a) :precision binary64 (+ (- x) x))
double code(double x, double y, double z, double t, double a) {
return -x + 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 = -x + x
end function
public static double code(double x, double y, double z, double t, double a) {
return -x + x;
}
def code(x, y, z, t, a): return -x + x
function code(x, y, z, t, a) return Float64(Float64(-x) + x) end
function tmp = code(x, y, z, t, a) tmp = -x + x; end
code[x_, y_, z_, t_, a_] := N[((-x) + x), $MachinePrecision]
\begin{array}{l}
\\
\left(-x\right) + x
\end{array}
Initial program 67.8%
Taylor expanded in z around inf
lower--.f6419.0
Applied rewrites19.0%
Taylor expanded in x around inf
Applied rewrites2.7%
Final simplification2.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 2024296
(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))))