
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ a (+ -1.0 (- z t))) (- y z) x))
double code(double x, double y, double z, double t, double a) {
return fma((a / (-1.0 + (z - t))), (y - z), x);
}
function code(x, y, z, t, a) return fma(Float64(a / Float64(-1.0 + Float64(z - t))), Float64(y - z), x) end
code[x_, y_, z_, t_, a_] := N[(N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{a}{-1 + \left(z - t\right)}, y - z, x\right)
\end{array}
Initial program 96.9%
sub-negN/A
+-commutativeN/A
clear-numN/A
associate-/r/N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr97.2%
Final simplification97.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y z) (/ (+ (- t z) 1.0) a))))
(if (<= t_1 -2e-113)
(- x a)
(if (<= t_1 5e-36) x (if (<= t_1 5e+306) (- x a) (* a (- y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_1 <= -2e-113) {
tmp = x - a;
} else if (t_1 <= 5e-36) {
tmp = x;
} else if (t_1 <= 5e+306) {
tmp = x - a;
} else {
tmp = a * -y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) / (((t - z) + 1.0d0) / a)
if (t_1 <= (-2d-113)) then
tmp = x - a
else if (t_1 <= 5d-36) then
tmp = x
else if (t_1 <= 5d+306) then
tmp = x - a
else
tmp = a * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_1 <= -2e-113) {
tmp = x - a;
} else if (t_1 <= 5e-36) {
tmp = x;
} else if (t_1 <= 5e+306) {
tmp = x - a;
} else {
tmp = a * -y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_1 <= -2e-113: tmp = x - a elif t_1 <= 5e-36: tmp = x elif t_1 <= 5e+306: tmp = x - a else: tmp = a * -y return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_1 <= -2e-113) tmp = Float64(x - a); elseif (t_1 <= 5e-36) tmp = x; elseif (t_1 <= 5e+306) tmp = Float64(x - a); else tmp = Float64(a * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_1 <= -2e-113) tmp = x - a; elseif (t_1 <= 5e-36) tmp = x; elseif (t_1 <= 5e+306) tmp = x - a; else tmp = a * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-113], N[(x - a), $MachinePrecision], If[LessEqual[t$95$1, 5e-36], x, If[LessEqual[t$95$1, 5e+306], N[(x - a), $MachinePrecision], N[(a * (-y)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-113}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-36}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-y\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -1.99999999999999996e-113 or 5.00000000000000004e-36 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 4.99999999999999993e306Initial program 99.7%
Taylor expanded in z around inf
Simplified57.9%
if -1.99999999999999996e-113 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 5.00000000000000004e-36Initial program 93.4%
Taylor expanded in x around inf
Simplified86.0%
if 4.99999999999999993e306 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 100.0%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0
Simplified100.0%
Taylor expanded in x around 0
mul-1-negN/A
distribute-neg-frac2N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64100.0
Simplified100.0%
Taylor expanded in z around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6492.9
Simplified92.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- y z) (/ (+ (- t z) 1.0) a)))) (if (<= t_1 -4e+51) (- a) (if (<= t_1 2e+100) x (- a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_1 <= -4e+51) {
tmp = -a;
} else if (t_1 <= 2e+100) {
tmp = x;
} else {
tmp = -a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) / (((t - z) + 1.0d0) / a)
if (t_1 <= (-4d+51)) then
tmp = -a
else if (t_1 <= 2d+100) then
tmp = x
else
tmp = -a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_1 <= -4e+51) {
tmp = -a;
} else if (t_1 <= 2e+100) {
tmp = x;
} else {
tmp = -a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_1 <= -4e+51: tmp = -a elif t_1 <= 2e+100: tmp = x else: tmp = -a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_1 <= -4e+51) tmp = Float64(-a); elseif (t_1 <= 2e+100) tmp = x; else tmp = Float64(-a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_1 <= -4e+51) tmp = -a; elseif (t_1 <= 2e+100) tmp = x; else tmp = -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+51], (-a), If[LessEqual[t$95$1, 2e+100], x, (-a)]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+51}:\\
\;\;\;\;-a\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+100}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-a\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -4e51 or 2.00000000000000003e100 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 99.7%
Taylor expanded in z around inf
Simplified42.8%
Taylor expanded in x around 0
mul-1-negN/A
neg-lowering-neg.f6438.3
Simplified38.3%
if -4e51 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 2.00000000000000003e100Initial program 95.5%
Taylor expanded in x around inf
Simplified73.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- a) t) (- y z) x)))
(if (<= t -1.22e+143)
t_1
(if (<= t 6.2e+34) (fma (- y z) (/ a (+ -1.0 z)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((-a / t), (y - z), x);
double tmp;
if (t <= -1.22e+143) {
tmp = t_1;
} else if (t <= 6.2e+34) {
tmp = fma((y - z), (a / (-1.0 + z)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(-a) / t), Float64(y - z), x) tmp = 0.0 if (t <= -1.22e+143) tmp = t_1; elseif (t <= 6.2e+34) tmp = fma(Float64(y - z), Float64(a / Float64(-1.0 + z)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[((-a) / t), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -1.22e+143], t$95$1, If[LessEqual[t, 6.2e+34], N[(N[(y - z), $MachinePrecision] * N[(a / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-a}{t}, y - z, x\right)\\
\mathbf{if}\;t \leq -1.22 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{a}{-1 + z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.22000000000000004e143 or 6.19999999999999955e34 < t Initial program 93.7%
sub-negN/A
+-commutativeN/A
clear-numN/A
associate-/r/N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr94.3%
Taylor expanded in t around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6486.5
Simplified86.5%
if -1.22000000000000004e143 < t < 6.19999999999999955e34Initial program 98.7%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
--lowering--.f6497.6
Simplified97.6%
Final simplification93.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6e+75)
(fma a (/ z (- t z)) x)
(if (<= z 3.25e-54)
(fma a (/ y (- -1.0 t)) x)
(fma a (/ z (+ t (- 1.0 z))) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+75) {
tmp = fma(a, (z / (t - z)), x);
} else if (z <= 3.25e-54) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = fma(a, (z / (t + (1.0 - z))), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+75) tmp = fma(a, Float64(z / Float64(t - z)), x); elseif (z <= 3.25e-54) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = fma(a, Float64(z / Float64(t + Float64(1.0 - z))), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+75], N[(a * N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 3.25e-54], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(a * N[(z / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{t - z}, x\right)\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{-54}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{t + \left(1 - z\right)}, x\right)\\
\end{array}
\end{array}
if z < -6e75Initial program 94.7%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6490.7
Simplified90.7%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6490.7
Simplified90.7%
if -6e75 < z < 3.24999999999999996e-54Initial program 97.5%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6494.3
Simplified94.3%
if 3.24999999999999996e-54 < z Initial program 97.5%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6486.9
Simplified86.9%
Final simplification91.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ z (- t z)) x)))
(if (<= z -1.1e+76)
t_1
(if (<= z 2.12e-13) (fma a (/ y (- -1.0 t)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, (z / (t - z)), x);
double tmp;
if (z <= -1.1e+76) {
tmp = t_1;
} else if (z <= 2.12e-13) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(z / Float64(t - z)), x) tmp = 0.0 if (z <= -1.1e+76) tmp = t_1; elseif (z <= 2.12e-13) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.1e+76], t$95$1, If[LessEqual[z, 2.12e-13], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{z}{t - z}, x\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.12 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1e76 or 2.1200000000000001e-13 < z Initial program 96.2%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6489.1
Simplified89.1%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6489.1
Simplified89.1%
if -1.1e76 < z < 2.1200000000000001e-13Initial program 97.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6493.2
Simplified93.2%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.7e+76) (fma z (/ a (- t z)) x) (if (<= z 2.3e-13) (fma a (/ y (- -1.0 t)) x) (fma (/ a z) (- y z) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e+76) {
tmp = fma(z, (a / (t - z)), x);
} else if (z <= 2.3e-13) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = fma((a / z), (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e+76) tmp = fma(z, Float64(a / Float64(t - z)), x); elseif (z <= 2.3e-13) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = fma(Float64(a / z), Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e+76], N[(z * N[(a / N[(t - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2.3e-13], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(a / z), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{a}{t - z}, x\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{z}, y - z, x\right)\\
\end{array}
\end{array}
if z < -2.6999999999999999e76Initial program 94.7%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6490.7
Simplified90.7%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6490.7
Simplified90.7%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6486.6
Simplified86.6%
if -2.6999999999999999e76 < z < 2.29999999999999979e-13Initial program 97.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6493.2
Simplified93.2%
if 2.29999999999999979e-13 < z Initial program 97.3%
sub-negN/A
+-commutativeN/A
clear-numN/A
associate-/r/N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr97.2%
Taylor expanded in z around inf
/-lowering-/.f6487.6
Simplified87.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma z (/ a (- t z)) x)))
(if (<= z -1.28e+76)
t_1
(if (<= z 2.3e-13) (fma a (/ y (- -1.0 t)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, (a / (t - z)), x);
double tmp;
if (z <= -1.28e+76) {
tmp = t_1;
} else if (z <= 2.3e-13) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(a / Float64(t - z)), x) tmp = 0.0 if (z <= -1.28e+76) tmp = t_1; elseif (z <= 2.3e-13) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(a / N[(t - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.28e+76], t$95$1, If[LessEqual[z, 2.3e-13], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{a}{t - z}, x\right)\\
\mathbf{if}\;z \leq -1.28 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.27999999999999994e76 or 2.29999999999999979e-13 < z Initial program 96.2%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6489.1
Simplified89.1%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6489.1
Simplified89.1%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6485.8
Simplified85.8%
if -1.27999999999999994e76 < z < 2.29999999999999979e-13Initial program 97.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6493.2
Simplified93.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.5e+81) (- x a) (if (<= z 2.3e-13) (fma a (/ y (- -1.0 t)) x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+81) {
tmp = x - a;
} else if (z <= 2.3e-13) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+81) tmp = Float64(x - a); elseif (z <= 2.3e-13) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+81], N[(x - a), $MachinePrecision], If[LessEqual[z, 2.3e-13], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+81}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -8.49999999999999986e81 or 2.29999999999999979e-13 < z Initial program 96.2%
Taylor expanded in z around inf
Simplified81.1%
if -8.49999999999999986e81 < z < 2.29999999999999979e-13Initial program 97.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6492.5
Simplified92.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.3e+75) (- x a) (if (<= z 2.3e-13) (- x (* a y)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.3e+75) {
tmp = x - a;
} else if (z <= 2.3e-13) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.3d+75)) then
tmp = x - a
else if (z <= 2.3d-13) then
tmp = x - (a * y)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.3e+75) {
tmp = x - a;
} else if (z <= 2.3e-13) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.3e+75: tmp = x - a elif z <= 2.3e-13: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.3e+75) tmp = Float64(x - a); elseif (z <= 2.3e-13) tmp = Float64(x - Float64(a * y)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.3e+75) tmp = x - a; elseif (z <= 2.3e-13) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.3e+75], N[(x - a), $MachinePrecision], If[LessEqual[z, 2.3e-13], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{+75}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-13}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -5.2999999999999998e75 or 2.29999999999999979e-13 < z Initial program 96.2%
Taylor expanded in z around inf
Simplified80.5%
if -5.2999999999999998e75 < z < 2.29999999999999979e-13Initial program 97.7%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6477.5
Simplified77.5%
Taylor expanded in z around 0
--lowering--.f64N/A
*-lowering-*.f6475.7
Simplified75.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.25e-10) (- x a) (if (<= z 250000000000.0) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.25e-10) {
tmp = x - a;
} else if (z <= 250000000000.0) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.25d-10)) then
tmp = x - a
else if (z <= 250000000000.0d0) then
tmp = x
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.25e-10) {
tmp = x - a;
} else if (z <= 250000000000.0) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.25e-10: tmp = x - a elif z <= 250000000000.0: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.25e-10) tmp = Float64(x - a); elseif (z <= 250000000000.0) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.25e-10) tmp = x - a; elseif (z <= 250000000000.0) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.25e-10], N[(x - a), $MachinePrecision], If[LessEqual[z, 250000000000.0], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.25 \cdot 10^{-10}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 250000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.2499999999999998e-10 or 2.5e11 < z Initial program 95.8%
Taylor expanded in z around inf
Simplified78.7%
if -4.2499999999999998e-10 < z < 2.5e11Initial program 98.2%
Taylor expanded in x around inf
Simplified57.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return 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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.9%
Taylor expanded in x around inf
Simplified49.9%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (((y - z) / ((t - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a): return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((y - z) / ((t - z) + 1.0)) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
\end{array}
herbie shell --seed 2024204
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))