
(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(a / Float64(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[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{a}{\frac{\left(t - z\right) + 1}{z - y}}
\end{array}
Initial program 97.3%
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
--lowering--.f6499.3%
Applied egg-rr99.3%
Final simplification99.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* a (/ (- z y) t)))))
(if (<= t -4.7e+70)
t_1
(if (<= t 1.1e+121) (+ x (/ a (/ (- 1.0 z) (- z y)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a * ((z - y) / t));
double tmp;
if (t <= -4.7e+70) {
tmp = t_1;
} else if (t <= 1.1e+121) {
tmp = x + (a / ((1.0 - z) / (z - 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 * ((z - y) / t))
if (t <= (-4.7d+70)) then
tmp = t_1
else if (t <= 1.1d+121) then
tmp = x + (a / ((1.0d0 - z) / (z - 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 * ((z - y) / t));
double tmp;
if (t <= -4.7e+70) {
tmp = t_1;
} else if (t <= 1.1e+121) {
tmp = x + (a / ((1.0 - z) / (z - y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a * ((z - y) / t)) tmp = 0 if t <= -4.7e+70: tmp = t_1 elif t <= 1.1e+121: tmp = x + (a / ((1.0 - z) / (z - y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a * Float64(Float64(z - y) / t))) tmp = 0.0 if (t <= -4.7e+70) tmp = t_1; elseif (t <= 1.1e+121) tmp = Float64(x + Float64(a / Float64(Float64(1.0 - z) / Float64(z - y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a * ((z - y) / t)); tmp = 0.0; if (t <= -4.7e+70) tmp = t_1; elseif (t <= 1.1e+121) tmp = x + (a / ((1.0 - z) / (z - y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.7e+70], t$95$1, If[LessEqual[t, 1.1e+121], N[(x + N[(a / N[(N[(1.0 - z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \frac{z - y}{t}\\
\mathbf{if}\;t \leq -4.7 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+121}:\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z - y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.6999999999999998e70 or 1.10000000000000001e121 < t Initial program 95.8%
Taylor expanded in t around inf
/-lowering-/.f6489.1%
Simplified89.1%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.0%
Applied egg-rr93.0%
if -4.6999999999999998e70 < t < 1.10000000000000001e121Initial program 98.1%
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.3%
Simplified94.3%
Final simplification93.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6e+51)
(- x a)
(if (<= z -2.2e-223)
(- x (/ y (/ t a)))
(if (<= z 0.0011) (- x (* a y)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+51) {
tmp = x - a;
} else if (z <= -2.2e-223) {
tmp = x - (y / (t / a));
} else if (z <= 0.0011) {
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 <= (-6d+51)) then
tmp = x - a
else if (z <= (-2.2d-223)) then
tmp = x - (y / (t / a))
else if (z <= 0.0011d0) 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 <= -6e+51) {
tmp = x - a;
} else if (z <= -2.2e-223) {
tmp = x - (y / (t / a));
} else if (z <= 0.0011) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e+51: tmp = x - a elif z <= -2.2e-223: tmp = x - (y / (t / a)) elif z <= 0.0011: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+51) tmp = Float64(x - a); elseif (z <= -2.2e-223) tmp = Float64(x - Float64(y / Float64(t / a))); elseif (z <= 0.0011) 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 <= -6e+51) tmp = x - a; elseif (z <= -2.2e-223) tmp = x - (y / (t / a)); elseif (z <= 0.0011) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+51], N[(x - a), $MachinePrecision], If[LessEqual[z, -2.2e-223], N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0011], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+51}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-223}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a}}\\
\mathbf{elif}\;z \leq 0.0011:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -6e51 or 0.00110000000000000007 < z Initial program 94.6%
Taylor expanded in z around inf
--lowering--.f6478.4%
Simplified78.4%
if -6e51 < z < -2.20000000000000009e-223Initial program 99.9%
Taylor expanded in t around inf
/-lowering-/.f6472.5%
Simplified72.5%
Taylor expanded in y around inf
Simplified75.0%
if -2.20000000000000009e-223 < z < 0.00110000000000000007Initial program 98.8%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6497.7%
Simplified97.7%
Taylor expanded in t around 0
--lowering--.f64N/A
*-lowering-*.f6479.4%
Simplified79.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -7e+50) (- x a) (if (<= z 1600000000000.0) (+ x (/ (* a y) (- -1.0 t))) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e+50) {
tmp = x - a;
} else if (z <= 1600000000000.0) {
tmp = x + ((a * y) / (-1.0 - t));
} 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 <= (-7d+50)) then
tmp = x - a
else if (z <= 1600000000000.0d0) then
tmp = x + ((a * y) / ((-1.0d0) - t))
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 <= -7e+50) {
tmp = x - a;
} else if (z <= 1600000000000.0) {
tmp = x + ((a * y) / (-1.0 - t));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7e+50: tmp = x - a elif z <= 1600000000000.0: tmp = x + ((a * y) / (-1.0 - t)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e+50) tmp = Float64(x - a); elseif (z <= 1600000000000.0) tmp = Float64(x + Float64(Float64(a * y) / Float64(-1.0 - t))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7e+50) tmp = x - a; elseif (z <= 1600000000000.0) tmp = x + ((a * y) / (-1.0 - t)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e+50], N[(x - a), $MachinePrecision], If[LessEqual[z, 1600000000000.0], N[(x + N[(N[(a * y), $MachinePrecision] / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+50}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1600000000000:\\
\;\;\;\;x + \frac{a \cdot y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -7.00000000000000012e50 or 1.6e12 < z Initial program 94.3%
Taylor expanded in z around inf
--lowering--.f6478.3%
Simplified78.3%
if -7.00000000000000012e50 < z < 1.6e12Initial program 99.3%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6492.9%
Simplified92.9%
Final simplification87.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* a (/ (- z y) t)))))
(if (<= t -4.3e+70)
t_1
(if (<= t 3.1e-18) (+ 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 * ((z - y) / t));
double tmp;
if (t <= -4.3e+70) {
tmp = t_1;
} else if (t <= 3.1e-18) {
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 * ((z - y) / t))
if (t <= (-4.3d+70)) then
tmp = t_1
else if (t <= 3.1d-18) 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 * ((z - y) / t));
double tmp;
if (t <= -4.3e+70) {
tmp = t_1;
} else if (t <= 3.1e-18) {
tmp = x + (a * (y / (z + -1.0)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a * ((z - y) / t)) tmp = 0 if t <= -4.3e+70: tmp = t_1 elif t <= 3.1e-18: 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(a * Float64(Float64(z - y) / t))) tmp = 0.0 if (t <= -4.3e+70) tmp = t_1; elseif (t <= 3.1e-18) 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 * ((z - y) / t)); tmp = 0.0; if (t <= -4.3e+70) tmp = t_1; elseif (t <= 3.1e-18) 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[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.3e+70], t$95$1, If[LessEqual[t, 3.1e-18], 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 + a \cdot \frac{z - y}{t}\\
\mathbf{if}\;t \leq -4.3 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-18}:\\
\;\;\;\;x + a \cdot \frac{y}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.3000000000000001e70 or 3.10000000000000007e-18 < t Initial program 96.6%
Taylor expanded in t around inf
/-lowering-/.f6486.9%
Simplified86.9%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6489.2%
Applied egg-rr89.2%
if -4.3000000000000001e70 < t < 3.10000000000000007e-18Initial program 97.8%
Taylor expanded in y around inf
Simplified79.4%
Taylor expanded in t around 0
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6476.9%
Simplified76.9%
Final simplification82.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y t)))))
(if (<= t -2.6e+30)
t_1
(if (<= t 3.1e-18) (+ 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 * (y / t));
double tmp;
if (t <= -2.6e+30) {
tmp = t_1;
} else if (t <= 3.1e-18) {
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 * (y / t))
if (t <= (-2.6d+30)) then
tmp = t_1
else if (t <= 3.1d-18) 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 * (y / t));
double tmp;
if (t <= -2.6e+30) {
tmp = t_1;
} else if (t <= 3.1e-18) {
tmp = x + (a * (y / (z + -1.0)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) tmp = 0 if t <= -2.6e+30: tmp = t_1 elif t <= 3.1e-18: 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(a * Float64(y / t))) tmp = 0.0 if (t <= -2.6e+30) tmp = t_1; elseif (t <= 3.1e-18) 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 * (y / t)); tmp = 0.0; if (t <= -2.6e+30) tmp = t_1; elseif (t <= 3.1e-18) 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[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e+30], t$95$1, If[LessEqual[t, 3.1e-18], 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 - a \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-18}:\\
\;\;\;\;x + a \cdot \frac{y}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.59999999999999988e30 or 3.10000000000000007e-18 < t Initial program 96.8%
Taylor expanded in t around inf
/-lowering-/.f6484.7%
Simplified84.7%
Taylor expanded in y around inf
Simplified80.6%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6481.9%
Applied egg-rr81.9%
if -2.59999999999999988e30 < t < 3.10000000000000007e-18Initial program 97.7%
Taylor expanded in y around inf
Simplified78.7%
Taylor expanded in t around 0
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6477.5%
Simplified77.5%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* a (/ y t))))) (if (<= t -2.6e-24) t_1 (if (<= t 3.1e-18) (- x (* a y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / t));
double tmp;
if (t <= -2.6e-24) {
tmp = t_1;
} else if (t <= 3.1e-18) {
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 * (y / t))
if (t <= (-2.6d-24)) then
tmp = t_1
else if (t <= 3.1d-18) 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 * (y / t));
double tmp;
if (t <= -2.6e-24) {
tmp = t_1;
} else if (t <= 3.1e-18) {
tmp = x - (a * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) tmp = 0 if t <= -2.6e-24: tmp = t_1 elif t <= 3.1e-18: tmp = x - (a * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / t))) tmp = 0.0 if (t <= -2.6e-24) tmp = t_1; elseif (t <= 3.1e-18) 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 * (y / t)); tmp = 0.0; if (t <= -2.6e-24) tmp = t_1; elseif (t <= 3.1e-18) 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[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e-24], t$95$1, If[LessEqual[t, 3.1e-18], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-18}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.6e-24 or 3.10000000000000007e-18 < t Initial program 97.1%
Taylor expanded in t around inf
/-lowering-/.f6481.0%
Simplified81.0%
Taylor expanded in y around inf
Simplified77.5%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6478.7%
Applied egg-rr78.7%
if -2.6e-24 < t < 3.10000000000000007e-18Initial program 97.5%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6473.0%
Simplified73.0%
Taylor expanded in t around 0
--lowering--.f64N/A
*-lowering-*.f6473.0%
Simplified73.0%
Final simplification76.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -8e-21) (- x a) (if (<= z 0.0024) (- x (* a y)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e-21) {
tmp = x - a;
} else if (z <= 0.0024) {
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 <= (-8d-21)) then
tmp = x - a
else if (z <= 0.0024d0) 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 <= -8e-21) {
tmp = x - a;
} else if (z <= 0.0024) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e-21: tmp = x - a elif z <= 0.0024: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e-21) tmp = Float64(x - a); elseif (z <= 0.0024) 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 <= -8e-21) tmp = x - a; elseif (z <= 0.0024) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e-21], N[(x - a), $MachinePrecision], If[LessEqual[z, 0.0024], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-21}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 0.0024:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -7.99999999999999926e-21 or 0.00239999999999999979 < z Initial program 95.3%
Taylor expanded in z around inf
--lowering--.f6475.6%
Simplified75.6%
if -7.99999999999999926e-21 < z < 0.00239999999999999979Initial program 99.2%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6495.3%
Simplified95.3%
Taylor expanded in t around 0
--lowering--.f64N/A
*-lowering-*.f6474.9%
Simplified74.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.8e+16) (- x a) (if (<= z 1.52e-33) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.8e+16) {
tmp = x - a;
} else if (z <= 1.52e-33) {
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 <= (-1.8d+16)) then
tmp = x - a
else if (z <= 1.52d-33) 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 <= -1.8e+16) {
tmp = x - a;
} else if (z <= 1.52e-33) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.8e+16: tmp = x - a elif z <= 1.52e-33: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.8e+16) tmp = Float64(x - a); elseif (z <= 1.52e-33) 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 <= -1.8e+16) tmp = x - a; elseif (z <= 1.52e-33) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.8e+16], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.52e-33], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+16}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-33}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.8e16 or 1.52e-33 < z Initial program 95.2%
Taylor expanded in z around inf
--lowering--.f6476.0%
Simplified76.0%
if -1.8e16 < z < 1.52e-33Initial program 99.2%
Taylor expanded in x around inf
Simplified65.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.5e+222) (- 0.0 a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.5e+222) {
tmp = 0.0 - a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.5d+222)) then
tmp = 0.0d0 - a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.5e+222) {
tmp = 0.0 - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.5e+222: tmp = 0.0 - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.5e+222) tmp = Float64(0.0 - a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.5e+222) tmp = 0.0 - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.5e+222], N[(0.0 - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+222}:\\
\;\;\;\;0 - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.50000000000000012e222Initial program 100.0%
Taylor expanded in z around inf
--lowering--.f6441.3%
Simplified41.3%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6442.0%
Simplified42.0%
sub0-negN/A
neg-lowering-neg.f6442.0%
Applied egg-rr42.0%
if -2.50000000000000012e222 < a Initial program 97.1%
Taylor expanded in x around inf
Simplified61.3%
Final simplification59.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 97.3%
Taylor expanded in x around inf
Simplified58.2%
(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 2024160
(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))))