
(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 21 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 (* (- t x) (/ (- z y) (- z a))))
(t_2 (fma (/ a (+ z a)) t_1 (fma (/ z (+ z a)) t_1 x))))
(if (<= a -3.35e-77)
t_2
(if (<= a 9e-42) (fma (/ (fma -1.0 t x) z) (- y a) t) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) * ((z - y) / (z - a));
double t_2 = fma((a / (z + a)), t_1, fma((z / (z + a)), t_1, x));
double tmp;
if (a <= -3.35e-77) {
tmp = t_2;
} else if (a <= 9e-42) {
tmp = fma((fma(-1.0, t, x) / z), (y - a), t);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) * Float64(Float64(z - y) / Float64(z - a))) t_2 = fma(Float64(a / Float64(z + a)), t_1, fma(Float64(z / Float64(z + a)), t_1, x)) tmp = 0.0 if (a <= -3.35e-77) tmp = t_2; elseif (a <= 9e-42) tmp = fma(Float64(fma(-1.0, t, x) / z), Float64(y - a), t); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a / N[(z + a), $MachinePrecision]), $MachinePrecision] * t$95$1 + N[(N[(z / N[(z + a), $MachinePrecision]), $MachinePrecision] * t$95$1 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.35e-77], t$95$2, If[LessEqual[a, 9e-42], N[(N[(N[(-1.0 * t + x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) \cdot \frac{z - y}{z - a}\\
t_2 := \mathsf{fma}\left(\frac{a}{z + a}, t\_1, \mathsf{fma}\left(\frac{z}{z + a}, t\_1, x\right)\right)\\
\mathbf{if}\;a \leq -3.35 \cdot 10^{-77}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(-1, t, x\right)}{z}, y - a, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -3.3499999999999999e-77 or 9e-42 < a Initial program 62.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6488.5
Applied rewrites88.5%
Applied rewrites92.2%
if -3.3499999999999999e-77 < a < 9e-42Initial program 58.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 rewrites88.0%
Final simplification90.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- y a) (/ (fma -1.0 t x) z))))
(if (<= z -2e+193)
(- t (* (/ (- t x) z) (- y a)))
(if (<= z 6.5e+178)
(- x (/ (- z y) (/ (- z a) (- x t))))
(+ (fma t_1 (/ a z) t_1) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - a) * (fma(-1.0, t, x) / z);
double tmp;
if (z <= -2e+193) {
tmp = t - (((t - x) / z) * (y - a));
} else if (z <= 6.5e+178) {
tmp = x - ((z - y) / ((z - a) / (x - t)));
} else {
tmp = fma(t_1, (a / z), t_1) + t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - a) * Float64(fma(-1.0, t, x) / z)) tmp = 0.0 if (z <= -2e+193) tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))); elseif (z <= 6.5e+178) tmp = Float64(x - Float64(Float64(z - y) / Float64(Float64(z - a) / Float64(x - t)))); else tmp = Float64(fma(t_1, Float64(a / z), t_1) + t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - a), $MachinePrecision] * N[(N[(-1.0 * t + x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+193], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+178], N[(x - N[(N[(z - y), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[(a / z), $MachinePrecision] + t$95$1), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - a\right) \cdot \frac{\mathsf{fma}\left(-1, t, x\right)}{z}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+193}:\\
\;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+178}:\\
\;\;\;\;x - \frac{z - y}{\frac{z - a}{x - t}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \frac{a}{z}, t\_1\right) + t\\
\end{array}
\end{array}
if z < -2.00000000000000013e193Initial program 12.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6440.1
Applied rewrites40.1%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6499.9
Applied rewrites99.9%
if -2.00000000000000013e193 < z < 6.5000000000000005e178Initial program 71.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6488.1
Applied rewrites88.1%
if 6.5000000000000005e178 < z Initial program 27.1%
Taylor expanded in z around inf
Applied rewrites86.5%
Final simplification88.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* (/ (- t x) z) (- y a)))))
(if (<= z -2e+193)
t_1
(if (<= z 2.1e+178) (- x (/ (- z y) (/ (- z a) (- x t)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (((t - x) / z) * (y - a));
double tmp;
if (z <= -2e+193) {
tmp = t_1;
} else if (z <= 2.1e+178) {
tmp = x - ((z - y) / ((z - a) / (x - 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 - (((t - x) / z) * (y - a))
if (z <= (-2d+193)) then
tmp = t_1
else if (z <= 2.1d+178) then
tmp = x - ((z - y) / ((z - a) / (x - 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 - (((t - x) / z) * (y - a));
double tmp;
if (z <= -2e+193) {
tmp = t_1;
} else if (z <= 2.1e+178) {
tmp = x - ((z - y) / ((z - a) / (x - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (((t - x) / z) * (y - a)) tmp = 0 if z <= -2e+193: tmp = t_1 elif z <= 2.1e+178: tmp = x - ((z - y) / ((z - a) / (x - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))) tmp = 0.0 if (z <= -2e+193) tmp = t_1; elseif (z <= 2.1e+178) tmp = Float64(x - Float64(Float64(z - y) / Float64(Float64(z - a) / Float64(x - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (((t - x) / z) * (y - a)); tmp = 0.0; if (z <= -2e+193) tmp = t_1; elseif (z <= 2.1e+178) tmp = x - ((z - y) / ((z - a) / (x - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+193], t$95$1, If[LessEqual[z, 2.1e+178], N[(x - N[(N[(z - y), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+193}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+178}:\\
\;\;\;\;x - \frac{z - y}{\frac{z - a}{x - t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.00000000000000013e193 or 2.0999999999999999e178 < z Initial program 21.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6449.2
Applied rewrites49.2%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6490.7
Applied rewrites90.7%
if -2.00000000000000013e193 < z < 2.0999999999999999e178Initial program 71.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6488.1
Applied rewrites88.1%
Final simplification88.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -32000.0)
(fma (- t x) (/ y a) x)
(if (<= a 4.2e-148)
(* (/ (- z y) z) t)
(if (<= a 3.2e+69) (* (/ t (- z a)) (- z y)) (fma (- y z) (/ t a) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -32000.0) {
tmp = fma((t - x), (y / a), x);
} else if (a <= 4.2e-148) {
tmp = ((z - y) / z) * t;
} else if (a <= 3.2e+69) {
tmp = (t / (z - a)) * (z - y);
} else {
tmp = fma((y - z), (t / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -32000.0) tmp = fma(Float64(t - x), Float64(y / a), x); elseif (a <= 4.2e-148) tmp = Float64(Float64(Float64(z - y) / z) * t); elseif (a <= 3.2e+69) tmp = Float64(Float64(t / Float64(z - a)) * Float64(z - y)); else tmp = fma(Float64(y - z), Float64(t / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -32000.0], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 4.2e-148], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[a, 3.2e+69], N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -32000:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-148}:\\
\;\;\;\;\frac{z - y}{z} \cdot t\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+69}:\\
\;\;\;\;\frac{t}{z - a} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\end{array}
\end{array}
if a < -32000Initial program 59.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6488.9
Applied rewrites88.9%
Taylor expanded in z around 0
lower-/.f6470.9
Applied rewrites70.9%
if -32000 < a < 4.2e-148Initial program 58.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6472.8
Applied rewrites72.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6452.3
Applied rewrites52.3%
Taylor expanded in a around 0
Applied rewrites65.0%
if 4.2e-148 < a < 3.19999999999999985e69Initial program 60.5%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6458.9
Applied rewrites58.9%
if 3.19999999999999985e69 < a Initial program 65.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.7
Applied rewrites80.7%
Taylor expanded in x around 0
Applied rewrites75.1%
Final simplification67.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- z y) (- z a)) x)))
(if (<= a -7.2e-174)
t_1
(if (<= a 4.8e-42) (fma (/ (fma -1.0 t x) z) (- y a) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((z - y) / (z - a)), x);
double tmp;
if (a <= -7.2e-174) {
tmp = t_1;
} else if (a <= 4.8e-42) {
tmp = fma((fma(-1.0, t, x) / 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(z - y) / Float64(z - a)), x) tmp = 0.0 if (a <= -7.2e-174) tmp = t_1; elseif (a <= 4.8e-42) tmp = fma(Float64(fma(-1.0, t, x) / 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[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -7.2e-174], t$95$1, If[LessEqual[a, 4.8e-42], N[(N[(N[(-1.0 * t + x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{z - y}{z - a}, x\right)\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{-174}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(-1, t, x\right)}{z}, y - a, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.19999999999999997e-174 or 4.80000000000000005e-42 < a Initial program 63.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6488.2
Applied rewrites88.2%
if -7.19999999999999997e-174 < a < 4.80000000000000005e-42Initial program 55.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
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.5%
Final simplification88.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* (/ (- z y) a) (- x t)) x)))
(if (<= a -88000.0)
t_1
(if (<= a 6e-34) (fma (/ (fma -1.0 t x) z) (- y a) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (((z - y) / a) * (x - t)) + x;
double tmp;
if (a <= -88000.0) {
tmp = t_1;
} else if (a <= 6e-34) {
tmp = fma((fma(-1.0, t, x) / z), (y - a), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(Float64(z - y) / a) * Float64(x - t)) + x) tmp = 0.0 if (a <= -88000.0) tmp = t_1; elseif (a <= 6e-34) tmp = fma(Float64(fma(-1.0, t, x) / 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[(N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -88000.0], t$95$1, If[LessEqual[a, 6e-34], N[(N[(N[(-1.0 * t + x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - y}{a} \cdot \left(x - t\right) + x\\
\mathbf{if}\;a \leq -88000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-34}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(-1, t, x\right)}{z}, y - a, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -88000 or 6e-34 < a Initial program 62.0%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6475.5
Applied rewrites75.5%
if -88000 < a < 6e-34Initial program 58.3%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites86.6%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* (/ (- z y) a) (- x t)) x)))
(if (<= a -88000.0)
t_1
(if (<= a 6e-34) (- t (* (/ (- t x) z) (- y a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (((z - y) / a) * (x - t)) + x;
double tmp;
if (a <= -88000.0) {
tmp = t_1;
} else if (a <= 6e-34) {
tmp = t - (((t - x) / z) * (y - a));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (((z - y) / a) * (x - t)) + x
if (a <= (-88000.0d0)) then
tmp = t_1
else if (a <= 6d-34) then
tmp = t - (((t - x) / z) * (y - a))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (((z - y) / a) * (x - t)) + x;
double tmp;
if (a <= -88000.0) {
tmp = t_1;
} else if (a <= 6e-34) {
tmp = t - (((t - x) / z) * (y - a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (((z - y) / a) * (x - t)) + x tmp = 0 if a <= -88000.0: tmp = t_1 elif a <= 6e-34: tmp = t - (((t - x) / z) * (y - a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(Float64(z - y) / a) * Float64(x - t)) + x) tmp = 0.0 if (a <= -88000.0) tmp = t_1; elseif (a <= 6e-34) tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (((z - y) / a) * (x - t)) + x; tmp = 0.0; if (a <= -88000.0) tmp = t_1; elseif (a <= 6e-34) tmp = t - (((t - x) / z) * (y - a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -88000.0], t$95$1, If[LessEqual[a, 6e-34], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - y}{a} \cdot \left(x - t\right) + x\\
\mathbf{if}\;a \leq -88000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-34}:\\
\;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -88000 or 6e-34 < a Initial program 62.0%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6475.5
Applied rewrites75.5%
if -88000 < a < 6e-34Initial program 58.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6471.1
Applied rewrites71.1%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6486.6
Applied rewrites86.6%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -88000.0)
t_1
(if (<= a 6e-34) (- t (* (/ (- t x) z) (- y a))) 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 <= -88000.0) {
tmp = t_1;
} else if (a <= 6e-34) {
tmp = t - (((t - x) / z) * (y - a));
} 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 <= -88000.0) tmp = t_1; elseif (a <= 6e-34) tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -88000.0], t$95$1, If[LessEqual[a, 6e-34], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $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 -88000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-34}:\\
\;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -88000 or 6e-34 < a Initial program 62.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--.f6475.4
Applied rewrites75.4%
if -88000 < a < 6e-34Initial program 58.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6471.1
Applied rewrites71.1%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6486.6
Applied rewrites86.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -12600000.0)
t_1
(if (<= a 4.4e+15) (* t (/ (- z y) (- z a))) 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 <= -12600000.0) {
tmp = t_1;
} else if (a <= 4.4e+15) {
tmp = t * ((z - y) / (z - a));
} 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 <= -12600000.0) tmp = t_1; elseif (a <= 4.4e+15) tmp = Float64(t * Float64(Float64(z - y) / Float64(z - a))); 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, -12600000.0], t$95$1, If[LessEqual[a, 4.4e+15], N[(t * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $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 -12600000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.4 \cdot 10^{+15}:\\
\;\;\;\;t \cdot \frac{z - y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.26e7 or 4.4e15 < a Initial program 62.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--.f6476.9
Applied rewrites76.9%
if -1.26e7 < a < 4.4e15Initial program 58.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6471.6
Applied rewrites71.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
Applied rewrites64.1%
Final simplification70.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (/ (- z y) (- z a))))) (if (<= z -5.5e-54) t_1 (if (<= z 2.25e+45) (fma (/ (- t x) a) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((z - y) / (z - a));
double tmp;
if (z <= -5.5e-54) {
tmp = t_1;
} else if (z <= 2.25e+45) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(z - y) / Float64(z - a))) tmp = 0.0 if (z <= -5.5e-54) tmp = t_1; elseif (z <= 2.25e+45) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e-54], t$95$1, If[LessEqual[z, 2.25e+45], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{z - y}{z - a}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.50000000000000046e-54 or 2.2499999999999999e45 < z Initial program 40.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6474.7
Applied rewrites74.7%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.6
Applied rewrites38.6%
Applied rewrites62.7%
if -5.50000000000000046e-54 < z < 2.2499999999999999e45Initial program 89.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.1
Applied rewrites76.1%
Final simplification68.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -32000.0) (fma (- t x) (/ y a) x) (if (<= a 2.3e-94) (* (/ (- z y) z) t) (fma (/ (- t x) a) y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -32000.0) {
tmp = fma((t - x), (y / a), x);
} else if (a <= 2.3e-94) {
tmp = ((z - y) / z) * t;
} else {
tmp = fma(((t - x) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -32000.0) tmp = fma(Float64(t - x), Float64(y / a), x); elseif (a <= 2.3e-94) tmp = Float64(Float64(Float64(z - y) / z) * t); else tmp = fma(Float64(Float64(t - x) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -32000.0], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 2.3e-94], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -32000:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-94}:\\
\;\;\;\;\frac{z - y}{z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\end{array}
\end{array}
if a < -32000Initial program 59.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6488.9
Applied rewrites88.9%
Taylor expanded in z around 0
lower-/.f6470.9
Applied rewrites70.9%
if -32000 < a < 2.2999999999999999e-94Initial program 57.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6473.0
Applied rewrites73.0%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6452.1
Applied rewrites52.1%
Taylor expanded in a around 0
Applied rewrites64.1%
if 2.2999999999999999e-94 < a Initial program 64.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6462.8
Applied rewrites62.8%
Final simplification65.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ z (- z a)) t)))
(if (<= z -1.1e+154)
t_1
(if (<= z 1.35e+133) (fma (/ (- t x) a) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z / (z - a)) * t;
double tmp;
if (z <= -1.1e+154) {
tmp = t_1;
} else if (z <= 1.35e+133) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z / Float64(z - a)) * t) tmp = 0.0 if (z <= -1.1e+154) tmp = t_1; elseif (z <= 1.35e+133) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[z, -1.1e+154], t$95$1, If[LessEqual[z, 1.35e+133], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{z - a} \cdot t\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+133}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1000000000000001e154 or 1.3500000000000001e133 < z Initial program 28.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6463.9
Applied rewrites63.9%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.6
Applied rewrites37.6%
Taylor expanded in y around 0
Applied rewrites60.0%
if -1.1000000000000001e154 < z < 1.3500000000000001e133Initial program 75.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6464.2
Applied rewrites64.2%
Final simplification62.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.2e+155) (fma a (/ t z) t) (if (<= z 1.35e+133) (fma (/ (- t x) a) y x) (* -1.0 (- t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+155) {
tmp = fma(a, (t / z), t);
} else if (z <= 1.35e+133) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = -1.0 * -t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e+155) tmp = fma(a, Float64(t / z), t); elseif (z <= 1.35e+133) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = Float64(-1.0 * Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e+155], N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 1.35e+133], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], N[(-1.0 * (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+133}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -1.2000000000000001e155Initial program 19.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6456.5
Applied rewrites56.5%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6444.0
Applied rewrites44.0%
Taylor expanded in y around 0
Applied rewrites74.7%
Taylor expanded in z around inf
Applied rewrites71.8%
if -1.2000000000000001e155 < z < 1.3500000000000001e133Initial program 75.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6464.2
Applied rewrites64.2%
if 1.3500000000000001e133 < z Initial program 33.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6468.6
Applied rewrites68.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6433.6
Applied rewrites33.6%
Taylor expanded in y around 0
Applied rewrites50.8%
Taylor expanded in z around inf
Applied rewrites41.5%
Final simplification60.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y z) (/ t a) x))) (if (<= a -32500.0) t_1 (if (<= a 5.8e-134) (fma a (/ t 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 <= -32500.0) {
tmp = t_1;
} else if (a <= 5.8e-134) {
tmp = fma(a, (t / 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 <= -32500.0) tmp = t_1; elseif (a <= 5.8e-134) tmp = fma(a, Float64(t / 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, -32500.0], t$95$1, If[LessEqual[a, 5.8e-134], N[(a * N[(t / 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 -32500:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-134}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -32500 or 5.79999999999999986e-134 < a Initial program 62.2%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6472.2
Applied rewrites72.2%
Taylor expanded in x around 0
Applied rewrites65.2%
if -32500 < a < 5.79999999999999986e-134Initial program 57.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6473.2
Applied rewrites73.2%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6451.8
Applied rewrites51.8%
Taylor expanded in y around 0
Applied rewrites46.2%
Taylor expanded in z around inf
Applied rewrites50.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -1e-25) (* (/ (- t x) a) y) (if (<= y 1.12e+73) (fma a (/ t z) t) (* (/ y a) (- t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1e-25) {
tmp = ((t - x) / a) * y;
} else if (y <= 1.12e+73) {
tmp = fma(a, (t / z), t);
} else {
tmp = (y / a) * (t - x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1e-25) tmp = Float64(Float64(Float64(t - x) / a) * y); elseif (y <= 1.12e+73) tmp = fma(a, Float64(t / z), t); else tmp = Float64(Float64(y / a) * Float64(t - x)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1e-25], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 1.12e+73], N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-25}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+73}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < -1.00000000000000004e-25Initial program 61.6%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6462.9
Applied rewrites62.9%
Taylor expanded in y around inf
Applied rewrites44.9%
if -1.00000000000000004e-25 < y < 1.12e73Initial program 54.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6473.9
Applied rewrites73.9%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.7
Applied rewrites37.7%
Taylor expanded in y around 0
Applied rewrites47.3%
Taylor expanded in z around inf
Applied rewrites43.6%
if 1.12e73 < y Initial program 71.5%
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.1
Applied rewrites66.1%
Taylor expanded in a around 0
Applied rewrites50.5%
Taylor expanded in y around inf
Applied rewrites47.4%
Final simplification44.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.5e-19) (fma a (/ t z) t) (if (<= z 8.8e+45) (* (/ y a) (- t x)) (* -1.0 (- t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-19) {
tmp = fma(a, (t / z), t);
} else if (z <= 8.8e+45) {
tmp = (y / a) * (t - x);
} else {
tmp = -1.0 * -t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e-19) tmp = fma(a, Float64(t / z), t); elseif (z <= 8.8e+45) tmp = Float64(Float64(y / a) * Float64(t - x)); else tmp = Float64(-1.0 * Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e-19], N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 8.8e+45], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(-1.0 * (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+45}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -9.4999999999999995e-19Initial program 36.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6471.5
Applied rewrites71.5%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
Applied rewrites53.2%
Taylor expanded in z around inf
Applied rewrites49.9%
if -9.4999999999999995e-19 < z < 8.8000000000000001e45Initial program 89.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.0
Applied rewrites76.0%
Taylor expanded in a around 0
Applied rewrites44.7%
Taylor expanded in y around inf
Applied rewrites41.8%
if 8.8000000000000001e45 < z Initial program 38.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6474.8
Applied rewrites74.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6436.3
Applied rewrites36.3%
Taylor expanded in y around 0
Applied rewrites47.2%
Taylor expanded in z around inf
Applied rewrites40.4%
Final simplification43.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y a) t))) (if (<= y -7.2e+132) t_1 (if (<= y 1.12e+73) (fma a (/ t z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * t;
double tmp;
if (y <= -7.2e+132) {
tmp = t_1;
} else if (y <= 1.12e+73) {
tmp = fma(a, (t / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * t) tmp = 0.0 if (y <= -7.2e+132) tmp = t_1; elseif (y <= 1.12e+73) tmp = fma(a, Float64(t / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -7.2e+132], t$95$1, If[LessEqual[y, 1.12e+73], N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot t\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+73}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.20000000000000031e132 or 1.12e73 < y Initial program 67.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6491.6
Applied rewrites91.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.6
Applied rewrites38.6%
Taylor expanded in z around 0
Applied rewrites33.2%
if -7.20000000000000031e132 < y < 1.12e73Initial program 56.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6474.6
Applied rewrites74.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.3
Applied rewrites38.3%
Taylor expanded in y around 0
Applied rewrites41.9%
Taylor expanded in z around inf
Applied rewrites39.3%
Final simplification37.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* -1.0 (- t)))) (if (<= z -4.5e-44) t_1 (if (<= z 1.04e-25) (* (/ y a) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -1.0 * -t;
double tmp;
if (z <= -4.5e-44) {
tmp = t_1;
} else if (z <= 1.04e-25) {
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 = (-1.0d0) * -t
if (z <= (-4.5d-44)) then
tmp = t_1
else if (z <= 1.04d-25) 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 = -1.0 * -t;
double tmp;
if (z <= -4.5e-44) {
tmp = t_1;
} else if (z <= 1.04e-25) {
tmp = (y / a) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -1.0 * -t tmp = 0 if z <= -4.5e-44: tmp = t_1 elif z <= 1.04e-25: tmp = (y / a) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-1.0 * Float64(-t)) tmp = 0.0 if (z <= -4.5e-44) tmp = t_1; elseif (z <= 1.04e-25) 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 = -1.0 * -t; tmp = 0.0; if (z <= -4.5e-44) tmp = t_1; elseif (z <= 1.04e-25) tmp = (y / a) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-1.0 * (-t)), $MachinePrecision]}, If[LessEqual[z, -4.5e-44], t$95$1, If[LessEqual[z, 1.04e-25], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -1 \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.04 \cdot 10^{-25}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.4999999999999999e-44 or 1.04000000000000004e-25 < z Initial program 41.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6473.8
Applied rewrites73.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6437.2
Applied rewrites37.2%
Taylor expanded in y around 0
Applied rewrites47.0%
Taylor expanded in z around inf
Applied rewrites41.8%
if -4.4999999999999999e-44 < z < 1.04000000000000004e-25Initial program 90.3%
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 x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.4
Applied rewrites40.4%
Taylor expanded in z around 0
Applied rewrites28.9%
Final simplification36.8%
(FPCore (x y z t a) :precision binary64 (* -1.0 (- t)))
double code(double x, double y, double z, double t, double a) {
return -1.0 * -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 = (-1.0d0) * -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -1.0 * -t;
}
def code(x, y, z, t, a): return -1.0 * -t
function code(x, y, z, t, a) return Float64(-1.0 * Float64(-t)) end
function tmp = code(x, y, z, t, a) tmp = -1.0 * -t; end
code[x_, y_, z_, t_, a_] := N[(-1.0 * (-t)), $MachinePrecision]
\begin{array}{l}
\\
-1 \cdot \left(-t\right)
\end{array}
Initial program 60.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6480.5
Applied rewrites80.5%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.4
Applied rewrites38.4%
Taylor expanded in y around 0
Applied rewrites31.1%
Taylor expanded in z around inf
Applied rewrites27.5%
Final simplification27.5%
(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 60.2%
Taylor expanded in z around inf
lower--.f6421.1
Applied rewrites21.1%
Final simplification21.1%
(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 60.2%
Taylor expanded in z around inf
lower--.f6421.1
Applied rewrites21.1%
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 2024294
(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))))