
(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 11 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 (+ x (* (/ a (+ (- t z) 1.0)) (- z y))))
double code(double x, double y, double z, double t, double a) {
return x + ((a / ((t - z) + 1.0)) * (z - y));
}
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 + ((a / ((t - z) + 1.0d0)) * (z - y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((a / ((t - z) + 1.0)) * (z - y));
}
def code(x, y, z, t, a): return x + ((a / ((t - z) + 1.0)) * (z - y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(a / Float64(Float64(t - z) + 1.0)) * Float64(z - y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((a / ((t - z) + 1.0)) * (z - y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(a / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{a}{\left(t - z\right) + 1} \cdot \left(z - y\right)
\end{array}
Initial program 97.0%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
--lowering--.f6497.3%
Applied egg-rr97.3%
Final simplification97.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (- z y) (/ t a)))))
(if (<= t -3.35e+72)
t_1
(if (<= t 4.5e+191) (+ x (* a (/ (- y z) (+ z -1.0)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((z - y) / (t / a));
double tmp;
if (t <= -3.35e+72) {
tmp = t_1;
} else if (t <= 4.5e+191) {
tmp = x + (a * ((y - z) / (z + -1.0)));
} 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 = x + ((z - y) / (t / a))
if (t <= (-3.35d+72)) then
tmp = t_1
else if (t <= 4.5d+191) then
tmp = x + (a * ((y - z) / (z + (-1.0d0))))
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 = x + ((z - y) / (t / a));
double tmp;
if (t <= -3.35e+72) {
tmp = t_1;
} else if (t <= 4.5e+191) {
tmp = x + (a * ((y - z) / (z + -1.0)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((z - y) / (t / a)) tmp = 0 if t <= -3.35e+72: tmp = t_1 elif t <= 4.5e+191: tmp = x + (a * ((y - z) / (z + -1.0))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(z - y) / Float64(t / a))) tmp = 0.0 if (t <= -3.35e+72) tmp = t_1; elseif (t <= 4.5e+191) tmp = Float64(x + Float64(a * Float64(Float64(y - z) / Float64(z + -1.0)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((z - y) / (t / a)); tmp = 0.0; if (t <= -3.35e+72) tmp = t_1; elseif (t <= 4.5e+191) tmp = x + (a * ((y - z) / (z + -1.0))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(z - y), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.35e+72], t$95$1, If[LessEqual[t, 4.5e+191], N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z - y}{\frac{t}{a}}\\
\mathbf{if}\;t \leq -3.35 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+191}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.3499999999999999e72 or 4.5000000000000002e191 < t Initial program 96.8%
Taylor expanded in t around inf
/-lowering-/.f6490.7%
Simplified90.7%
if -3.3499999999999999e72 < t < 4.5000000000000002e191Initial program 97.1%
Taylor expanded in t around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6480.6%
Simplified80.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6492.2%
Applied egg-rr92.2%
Final simplification91.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* a (/ z (- (+ t 1.0) z))))))
(if (<= z -9e+37)
t_1
(if (<= z 800000000000.0) (+ x (/ (* a y) (- -1.0 t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a * (z / ((t + 1.0) - z)));
double tmp;
if (z <= -9e+37) {
tmp = t_1;
} else if (z <= 800000000000.0) {
tmp = x + ((a * y) / (-1.0 - 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 = x + (a * (z / ((t + 1.0d0) - z)))
if (z <= (-9d+37)) then
tmp = t_1
else if (z <= 800000000000.0d0) then
tmp = x + ((a * y) / ((-1.0d0) - 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 = x + (a * (z / ((t + 1.0) - z)));
double tmp;
if (z <= -9e+37) {
tmp = t_1;
} else if (z <= 800000000000.0) {
tmp = x + ((a * y) / (-1.0 - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a * (z / ((t + 1.0) - z))) tmp = 0 if z <= -9e+37: tmp = t_1 elif z <= 800000000000.0: tmp = x + ((a * y) / (-1.0 - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a * Float64(z / Float64(Float64(t + 1.0) - z)))) tmp = 0.0 if (z <= -9e+37) tmp = t_1; elseif (z <= 800000000000.0) tmp = Float64(x + Float64(Float64(a * y) / Float64(-1.0 - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a * (z / ((t + 1.0) - z))); tmp = 0.0; if (z <= -9e+37) tmp = t_1; elseif (z <= 800000000000.0) tmp = x + ((a * y) / (-1.0 - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a * N[(z / N[(N[(t + 1.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e+37], t$95$1, If[LessEqual[z, 800000000000.0], N[(x + N[(N[(a * y), $MachinePrecision] / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \frac{z}{\left(t + 1\right) - z}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 800000000000:\\
\;\;\;\;x + \frac{a \cdot y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.99999999999999923e37 or 8e11 < z Initial program 94.4%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-lowering-+.f6482.0%
Simplified82.0%
if -8.99999999999999923e37 < z < 8e11Initial program 98.9%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6486.8%
Simplified86.8%
Final simplification84.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.3e+113)
(- x a)
(if (<= z -72000.0)
(+ x (/ (* a y) z))
(if (<= z 1.4e-13) (- x (* a y)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+113) {
tmp = x - a;
} else if (z <= -72000.0) {
tmp = x + ((a * y) / z);
} else if (z <= 1.4e-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 <= (-1.3d+113)) then
tmp = x - a
else if (z <= (-72000.0d0)) then
tmp = x + ((a * y) / z)
else if (z <= 1.4d-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 <= -1.3e+113) {
tmp = x - a;
} else if (z <= -72000.0) {
tmp = x + ((a * y) / z);
} else if (z <= 1.4e-13) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+113: tmp = x - a elif z <= -72000.0: tmp = x + ((a * y) / z) elif z <= 1.4e-13: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+113) tmp = Float64(x - a); elseif (z <= -72000.0) tmp = Float64(x + Float64(Float64(a * y) / z)); elseif (z <= 1.4e-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 <= -1.3e+113) tmp = x - a; elseif (z <= -72000.0) tmp = x + ((a * y) / z); elseif (z <= 1.4e-13) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+113], N[(x - a), $MachinePrecision], If[LessEqual[z, -72000.0], N[(x + N[(N[(a * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-13], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+113}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -72000:\\
\;\;\;\;x + \frac{a \cdot y}{z}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-13}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.3e113 or 1.4000000000000001e-13 < z Initial program 93.9%
Taylor expanded in z around inf
--lowering--.f6474.6%
Simplified74.6%
if -1.3e113 < z < -72000Initial program 100.0%
Taylor expanded in t around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6483.7%
Simplified83.7%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6483.9%
Applied egg-rr83.9%
Taylor expanded in y around inf
/-lowering-/.f64N/A
--lowering--.f6480.7%
Simplified80.7%
Taylor expanded in z around inf
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6479.4%
Simplified79.4%
if -72000 < z < 1.4000000000000001e-13Initial program 98.8%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6488.1%
Simplified88.1%
Taylor expanded in t around 0
--lowering--.f64N/A
*-lowering-*.f6474.7%
Simplified74.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.8e+30)
(+ x (/ (- z y) (/ t a)))
(if (<= t 6800000000000.0)
(+ x (* a (/ y (+ z -1.0))))
(+ x (* (/ a t) (- z y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.8e+30) {
tmp = x + ((z - y) / (t / a));
} else if (t <= 6800000000000.0) {
tmp = x + (a * (y / (z + -1.0)));
} else {
tmp = x + ((a / t) * (z - 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) :: tmp
if (t <= (-1.8d+30)) then
tmp = x + ((z - y) / (t / a))
else if (t <= 6800000000000.0d0) then
tmp = x + (a * (y / (z + (-1.0d0))))
else
tmp = x + ((a / t) * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.8e+30) {
tmp = x + ((z - y) / (t / a));
} else if (t <= 6800000000000.0) {
tmp = x + (a * (y / (z + -1.0)));
} else {
tmp = x + ((a / t) * (z - y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.8e+30: tmp = x + ((z - y) / (t / a)) elif t <= 6800000000000.0: tmp = x + (a * (y / (z + -1.0))) else: tmp = x + ((a / t) * (z - y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.8e+30) tmp = Float64(x + Float64(Float64(z - y) / Float64(t / a))); elseif (t <= 6800000000000.0) tmp = Float64(x + Float64(a * Float64(y / Float64(z + -1.0)))); else tmp = Float64(x + Float64(Float64(a / t) * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.8e+30) tmp = x + ((z - y) / (t / a)); elseif (t <= 6800000000000.0) tmp = x + (a * (y / (z + -1.0))); else tmp = x + ((a / t) * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.8e+30], N[(x + N[(N[(z - y), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6800000000000.0], N[(x + N[(a * N[(y / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+30}:\\
\;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\
\mathbf{elif}\;t \leq 6800000000000:\\
\;\;\;\;x + a \cdot \frac{y}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -1.8000000000000001e30Initial program 99.1%
Taylor expanded in t around inf
/-lowering-/.f6487.4%
Simplified87.4%
if -1.8000000000000001e30 < t < 6.8e12Initial program 96.8%
Taylor expanded in t around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6487.8%
Simplified87.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.4%
Applied egg-rr98.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
--lowering--.f6483.2%
Simplified83.2%
if 6.8e12 < t Initial program 95.6%
Taylor expanded in t around inf
/-lowering-/.f6477.9%
Simplified77.9%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6477.9%
Applied egg-rr77.9%
Final simplification82.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ a t) (- z y)))))
(if (<= t -5.8e+29)
t_1
(if (<= t 210000000000.0) (+ x (* a (/ y (+ z -1.0)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((a / t) * (z - y));
double tmp;
if (t <= -5.8e+29) {
tmp = t_1;
} else if (t <= 210000000000.0) {
tmp = x + (a * (y / (z + -1.0)));
} 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 = x + ((a / t) * (z - y))
if (t <= (-5.8d+29)) then
tmp = t_1
else if (t <= 210000000000.0d0) then
tmp = x + (a * (y / (z + (-1.0d0))))
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 = x + ((a / t) * (z - y));
double tmp;
if (t <= -5.8e+29) {
tmp = t_1;
} else if (t <= 210000000000.0) {
tmp = x + (a * (y / (z + -1.0)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((a / t) * (z - y)) tmp = 0 if t <= -5.8e+29: tmp = t_1 elif t <= 210000000000.0: tmp = x + (a * (y / (z + -1.0))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(a / t) * Float64(z - y))) tmp = 0.0 if (t <= -5.8e+29) tmp = t_1; elseif (t <= 210000000000.0) tmp = Float64(x + Float64(a * Float64(y / Float64(z + -1.0)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((a / t) * (z - y)); tmp = 0.0; if (t <= -5.8e+29) tmp = t_1; elseif (t <= 210000000000.0) tmp = x + (a * (y / (z + -1.0))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e+29], t$95$1, If[LessEqual[t, 210000000000.0], N[(x + N[(a * N[(y / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{a}{t} \cdot \left(z - y\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 210000000000:\\
\;\;\;\;x + a \cdot \frac{y}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.7999999999999999e29 or 2.1e11 < t Initial program 97.2%
Taylor expanded in t around inf
/-lowering-/.f6482.3%
Simplified82.3%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6482.3%
Applied egg-rr82.3%
if -5.7999999999999999e29 < t < 2.1e11Initial program 96.8%
Taylor expanded in t around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6487.8%
Simplified87.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.4%
Applied egg-rr98.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
--lowering--.f6483.2%
Simplified83.2%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* (/ a t) (- z y))))) (if (<= t -1.35e+28) t_1 (if (<= t 14000000000.0) (- x (* a y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((a / t) * (z - y));
double tmp;
if (t <= -1.35e+28) {
tmp = t_1;
} else if (t <= 14000000000.0) {
tmp = x - (a * y);
} 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 = x + ((a / t) * (z - y))
if (t <= (-1.35d+28)) then
tmp = t_1
else if (t <= 14000000000.0d0) then
tmp = x - (a * y)
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 = x + ((a / t) * (z - y));
double tmp;
if (t <= -1.35e+28) {
tmp = t_1;
} else if (t <= 14000000000.0) {
tmp = x - (a * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((a / t) * (z - y)) tmp = 0 if t <= -1.35e+28: tmp = t_1 elif t <= 14000000000.0: tmp = x - (a * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(a / t) * Float64(z - y))) tmp = 0.0 if (t <= -1.35e+28) tmp = t_1; elseif (t <= 14000000000.0) tmp = Float64(x - Float64(a * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((a / t) * (z - y)); tmp = 0.0; if (t <= -1.35e+28) tmp = t_1; elseif (t <= 14000000000.0) tmp = x - (a * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.35e+28], t$95$1, If[LessEqual[t, 14000000000.0], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{a}{t} \cdot \left(z - y\right)\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 14000000000:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.3500000000000001e28 or 1.4e10 < t Initial program 97.2%
Taylor expanded in t around inf
/-lowering-/.f6482.3%
Simplified82.3%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6482.3%
Applied egg-rr82.3%
if -1.3500000000000001e28 < t < 1.4e10Initial program 96.8%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6469.0%
Simplified69.0%
Taylor expanded in t around 0
--lowering--.f64N/A
*-lowering-*.f6467.5%
Simplified67.5%
Final simplification74.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -7600000000.0) (- x a) (if (<= z 1.4e-13) (- x (* a y)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7600000000.0) {
tmp = x - a;
} else if (z <= 1.4e-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 <= (-7600000000.0d0)) then
tmp = x - a
else if (z <= 1.4d-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 <= -7600000000.0) {
tmp = x - a;
} else if (z <= 1.4e-13) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7600000000.0: tmp = x - a elif z <= 1.4e-13: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7600000000.0) tmp = Float64(x - a); elseif (z <= 1.4e-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 <= -7600000000.0) tmp = x - a; elseif (z <= 1.4e-13) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7600000000.0], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.4e-13], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7600000000:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-13}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -7.6e9 or 1.4000000000000001e-13 < z Initial program 95.0%
Taylor expanded in z around inf
--lowering--.f6473.1%
Simplified73.1%
if -7.6e9 < z < 1.4000000000000001e-13Initial program 98.8%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6487.6%
Simplified87.6%
Taylor expanded in t around 0
--lowering--.f64N/A
*-lowering-*.f6473.7%
Simplified73.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -620000000000.0) (- x a) (if (<= z 8.5e-47) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -620000000000.0) {
tmp = x - a;
} else if (z <= 8.5e-47) {
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 <= (-620000000000.0d0)) then
tmp = x - a
else if (z <= 8.5d-47) 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 <= -620000000000.0) {
tmp = x - a;
} else if (z <= 8.5e-47) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -620000000000.0: tmp = x - a elif z <= 8.5e-47: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -620000000000.0) tmp = Float64(x - a); elseif (z <= 8.5e-47) 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 <= -620000000000.0) tmp = x - a; elseif (z <= 8.5e-47) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -620000000000.0], N[(x - a), $MachinePrecision], If[LessEqual[z, 8.5e-47], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -620000000000:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-47}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -6.2e11 or 8.4999999999999999e-47 < z Initial program 95.3%
Taylor expanded in z around inf
--lowering--.f6472.7%
Simplified72.7%
if -6.2e11 < z < 8.4999999999999999e-47Initial program 98.8%
Taylor expanded in x around inf
Simplified55.1%
(FPCore (x y z t a) :precision binary64 (if (<= a 6.5e+200) x (- 0.0 a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 6.5e+200) {
tmp = x;
} else {
tmp = 0.0 - 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 (a <= 6.5d+200) then
tmp = x
else
tmp = 0.0d0 - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 6.5e+200) {
tmp = x;
} else {
tmp = 0.0 - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 6.5e+200: tmp = x else: tmp = 0.0 - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 6.5e+200) tmp = x; else tmp = Float64(0.0 - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 6.5e+200) tmp = x; else tmp = 0.0 - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 6.5e+200], x, N[(0.0 - a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.5 \cdot 10^{+200}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0 - a\\
\end{array}
\end{array}
if a < 6.49999999999999963e200Initial program 96.6%
Taylor expanded in x around inf
Simplified60.6%
if 6.49999999999999963e200 < a Initial program 99.8%
Taylor expanded in z around inf
--lowering--.f6429.2%
Simplified29.2%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6429.2%
Simplified29.2%
sub0-negN/A
neg-lowering-neg.f6429.2%
Applied egg-rr29.2%
Final simplification56.7%
(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 97.0%
Taylor expanded in x around inf
Simplified53.7%
(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 2024158
(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))))