
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - 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 - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - 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 - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- z t) (- z a)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * 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 + (((z - t) / (z - a)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (z - a)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(z - a)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (z - a)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{z - a} \cdot y
\end{array}
Initial program 88.8%
associate-/l*99.2%
Simplified99.2%
clear-num99.0%
associate-/r/99.1%
clear-num99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y (- z a))))) (t_2 (+ x (* y (- 1.0 (/ t z))))))
(if (<= z -1.85e+58)
t_2
(if (<= z -2.2e-43)
t_1
(if (<= z 3.8e-15) (+ x (/ t (/ a y))) (if (<= z 9.5e+165) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / (z - a)));
double t_2 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -1.85e+58) {
tmp = t_2;
} else if (z <= -2.2e-43) {
tmp = t_1;
} else if (z <= 3.8e-15) {
tmp = x + (t / (a / y));
} else if (z <= 9.5e+165) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + (z * (y / (z - a)))
t_2 = x + (y * (1.0d0 - (t / z)))
if (z <= (-1.85d+58)) then
tmp = t_2
else if (z <= (-2.2d-43)) then
tmp = t_1
else if (z <= 3.8d-15) then
tmp = x + (t / (a / y))
else if (z <= 9.5d+165) then
tmp = t_1
else
tmp = t_2
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 / (z - a)));
double t_2 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -1.85e+58) {
tmp = t_2;
} else if (z <= -2.2e-43) {
tmp = t_1;
} else if (z <= 3.8e-15) {
tmp = x + (t / (a / y));
} else if (z <= 9.5e+165) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / (z - a))) t_2 = x + (y * (1.0 - (t / z))) tmp = 0 if z <= -1.85e+58: tmp = t_2 elif z <= -2.2e-43: tmp = t_1 elif z <= 3.8e-15: tmp = x + (t / (a / y)) elif z <= 9.5e+165: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / Float64(z - a)))) t_2 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) tmp = 0.0 if (z <= -1.85e+58) tmp = t_2; elseif (z <= -2.2e-43) tmp = t_1; elseif (z <= 3.8e-15) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 9.5e+165) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / (z - a))); t_2 = x + (y * (1.0 - (t / z))); tmp = 0.0; if (z <= -1.85e+58) tmp = t_2; elseif (z <= -2.2e-43) tmp = t_1; elseif (z <= 3.8e-15) tmp = x + (t / (a / y)); elseif (z <= 9.5e+165) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+58], t$95$2, If[LessEqual[z, -2.2e-43], t$95$1, If[LessEqual[z, 3.8e-15], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+165], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{z - a}\\
t_2 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+58}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-43}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+165}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.8500000000000001e58 or 9.50000000000000017e165 < z Initial program 79.6%
associate-/l*99.9%
Simplified99.9%
clear-num99.7%
associate-/r/99.9%
clear-num100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 93.7%
div-sub93.7%
*-inverses93.7%
Simplified93.7%
if -1.8500000000000001e58 < z < -2.19999999999999997e-43 or 3.8000000000000002e-15 < z < 9.50000000000000017e165Initial program 88.0%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in t around 0 77.6%
+-commutative77.6%
associate-*l/86.4%
*-commutative86.4%
Simplified86.4%
if -2.19999999999999997e-43 < z < 3.8000000000000002e-15Initial program 95.0%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around 0 81.4%
+-commutative81.4%
associate-/l*85.7%
Simplified85.7%
Final simplification88.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.1e+180)
(+ x y)
(if (<= z -4.8e-10)
(- x (* t (/ y z)))
(if (or (<= z -7.3e-37) (not (<= z 0.00128)))
(+ x y)
(+ x (/ t (/ a y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+180) {
tmp = x + y;
} else if (z <= -4.8e-10) {
tmp = x - (t * (y / z));
} else if ((z <= -7.3e-37) || !(z <= 0.00128)) {
tmp = x + y;
} else {
tmp = x + (t / (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) :: tmp
if (z <= (-1.1d+180)) then
tmp = x + y
else if (z <= (-4.8d-10)) then
tmp = x - (t * (y / z))
else if ((z <= (-7.3d-37)) .or. (.not. (z <= 0.00128d0))) then
tmp = x + y
else
tmp = x + (t / (a / y))
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.1e+180) {
tmp = x + y;
} else if (z <= -4.8e-10) {
tmp = x - (t * (y / z));
} else if ((z <= -7.3e-37) || !(z <= 0.00128)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+180: tmp = x + y elif z <= -4.8e-10: tmp = x - (t * (y / z)) elif (z <= -7.3e-37) or not (z <= 0.00128): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+180) tmp = Float64(x + y); elseif (z <= -4.8e-10) tmp = Float64(x - Float64(t * Float64(y / z))); elseif ((z <= -7.3e-37) || !(z <= 0.00128)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+180) tmp = x + y; elseif (z <= -4.8e-10) tmp = x - (t * (y / z)); elseif ((z <= -7.3e-37) || ~((z <= 0.00128))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+180], N[(x + y), $MachinePrecision], If[LessEqual[z, -4.8e-10], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -7.3e-37], N[Not[LessEqual[z, 0.00128]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+180}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-10}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -7.3 \cdot 10^{-37} \lor \neg \left(z \leq 0.00128\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.1e180 or -4.8e-10 < z < -7.2999999999999997e-37 or 0.0012800000000000001 < z Initial program 78.9%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in z around inf 83.5%
+-commutative83.5%
Simplified83.5%
if -1.1e180 < z < -4.8e-10Initial program 90.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.4%
Taylor expanded in z around 0 71.5%
associate-*r/71.5%
mul-1-neg71.5%
distribute-rgt-neg-out71.5%
Simplified71.5%
div-inv71.5%
add-sqr-sqrt33.0%
sqrt-unprod61.1%
sqr-neg61.1%
sqrt-unprod26.3%
add-sqr-sqrt51.1%
distribute-rgt-neg-in51.1%
cancel-sign-sub-inv51.1%
associate-*l*53.1%
add-sqr-sqrt28.3%
sqrt-unprod61.1%
sqr-neg61.1%
sqrt-unprod33.0%
add-sqr-sqrt73.5%
div-inv73.5%
Applied egg-rr73.5%
if -7.2999999999999997e-37 < z < 0.0012800000000000001Initial program 95.1%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
associate-/l*85.2%
Simplified85.2%
Final simplification82.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.1e+180)
(+ x y)
(if (<= z -1.8e-14)
(- x (* y (/ t z)))
(if (or (<= z -7.2e-37) (not (<= z 0.0185)))
(+ x y)
(+ x (/ t (/ a y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+180) {
tmp = x + y;
} else if (z <= -1.8e-14) {
tmp = x - (y * (t / z));
} else if ((z <= -7.2e-37) || !(z <= 0.0185)) {
tmp = x + y;
} else {
tmp = x + (t / (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) :: tmp
if (z <= (-1.1d+180)) then
tmp = x + y
else if (z <= (-1.8d-14)) then
tmp = x - (y * (t / z))
else if ((z <= (-7.2d-37)) .or. (.not. (z <= 0.0185d0))) then
tmp = x + y
else
tmp = x + (t / (a / y))
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.1e+180) {
tmp = x + y;
} else if (z <= -1.8e-14) {
tmp = x - (y * (t / z));
} else if ((z <= -7.2e-37) || !(z <= 0.0185)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+180: tmp = x + y elif z <= -1.8e-14: tmp = x - (y * (t / z)) elif (z <= -7.2e-37) or not (z <= 0.0185): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+180) tmp = Float64(x + y); elseif (z <= -1.8e-14) tmp = Float64(x - Float64(y * Float64(t / z))); elseif ((z <= -7.2e-37) || !(z <= 0.0185)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+180) tmp = x + y; elseif (z <= -1.8e-14) tmp = x - (y * (t / z)); elseif ((z <= -7.2e-37) || ~((z <= 0.0185))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+180], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.8e-14], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -7.2e-37], N[Not[LessEqual[z, 0.0185]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+180}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-14}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-37} \lor \neg \left(z \leq 0.0185\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.1e180 or -1.7999999999999999e-14 < z < -7.20000000000000014e-37 or 0.0184999999999999991 < z Initial program 78.9%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in z around inf 83.5%
+-commutative83.5%
Simplified83.5%
if -1.1e180 < z < -1.7999999999999999e-14Initial program 90.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.4%
Taylor expanded in z around 0 71.5%
associate-*r/71.5%
mul-1-neg71.5%
distribute-rgt-neg-out71.5%
Simplified71.5%
div-inv71.5%
add-sqr-sqrt33.0%
sqrt-unprod61.1%
sqr-neg61.1%
sqrt-unprod26.3%
add-sqr-sqrt51.1%
distribute-rgt-neg-in51.1%
cancel-sign-sub-inv51.1%
associate-*l*53.1%
add-sqr-sqrt28.3%
sqrt-unprod61.1%
sqr-neg61.1%
sqrt-unprod33.0%
add-sqr-sqrt73.5%
div-inv73.5%
Applied egg-rr73.5%
Taylor expanded in t around 0 71.5%
associate-*r/73.5%
remove-double-neg73.5%
*-commutative73.5%
distribute-rgt-neg-out73.5%
associate-*l/71.5%
associate-*r/73.5%
distribute-rgt-neg-in73.5%
distribute-frac-neg73.5%
remove-double-neg73.5%
Simplified73.5%
if -7.20000000000000014e-37 < z < 0.0184999999999999991Initial program 95.1%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
associate-/l*85.2%
Simplified85.2%
Final simplification82.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.45e+180)
(+ x y)
(if (<= z -3.8e-7)
(- x (/ t (/ z y)))
(if (or (<= z -1.75e-38) (not (<= z 0.00118)))
(+ x y)
(+ x (/ t (/ a y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e+180) {
tmp = x + y;
} else if (z <= -3.8e-7) {
tmp = x - (t / (z / y));
} else if ((z <= -1.75e-38) || !(z <= 0.00118)) {
tmp = x + y;
} else {
tmp = x + (t / (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) :: tmp
if (z <= (-1.45d+180)) then
tmp = x + y
else if (z <= (-3.8d-7)) then
tmp = x - (t / (z / y))
else if ((z <= (-1.75d-38)) .or. (.not. (z <= 0.00118d0))) then
tmp = x + y
else
tmp = x + (t / (a / y))
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.45e+180) {
tmp = x + y;
} else if (z <= -3.8e-7) {
tmp = x - (t / (z / y));
} else if ((z <= -1.75e-38) || !(z <= 0.00118)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.45e+180: tmp = x + y elif z <= -3.8e-7: tmp = x - (t / (z / y)) elif (z <= -1.75e-38) or not (z <= 0.00118): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e+180) tmp = Float64(x + y); elseif (z <= -3.8e-7) tmp = Float64(x - Float64(t / Float64(z / y))); elseif ((z <= -1.75e-38) || !(z <= 0.00118)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.45e+180) tmp = x + y; elseif (z <= -3.8e-7) tmp = x - (t / (z / y)); elseif ((z <= -1.75e-38) || ~((z <= 0.00118))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.45e+180], N[(x + y), $MachinePrecision], If[LessEqual[z, -3.8e-7], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.75e-38], N[Not[LessEqual[z, 0.00118]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+180}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-7}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-38} \lor \neg \left(z \leq 0.00118\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.45000000000000004e180 or -3.80000000000000015e-7 < z < -1.7500000000000001e-38 or 0.0011800000000000001 < z Initial program 78.9%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in z around inf 83.5%
+-commutative83.5%
Simplified83.5%
if -1.45000000000000004e180 < z < -3.80000000000000015e-7Initial program 90.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.4%
Taylor expanded in z around 0 71.5%
associate-*r/71.5%
mul-1-neg71.5%
distribute-rgt-neg-out71.5%
Simplified71.5%
Taylor expanded in x around 0 71.5%
mul-1-neg71.5%
associate-*r/73.5%
sub-neg73.5%
associate-*r/71.5%
associate-/l*73.5%
Simplified73.5%
if -1.7500000000000001e-38 < z < 0.0011800000000000001Initial program 95.1%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
associate-/l*85.2%
Simplified85.2%
Final simplification82.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e-37) (not (<= z 3.8e-43))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e-37) || !(z <= 3.8e-43)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / 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 <= (-7.2d-37)) .or. (.not. (z <= 3.8d-43))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (t * (y / 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 <= -7.2e-37) || !(z <= 3.8e-43)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e-37) or not (z <= 3.8e-43): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e-37) || !(z <= 3.8e-43)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.2e-37) || ~((z <= 3.8e-43))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e-37], N[Not[LessEqual[z, 3.8e-43]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-37} \lor \neg \left(z \leq 3.8 \cdot 10^{-43}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -7.20000000000000014e-37 or 3.7999999999999997e-43 < z Initial program 84.2%
associate-/l*99.3%
Simplified99.3%
clear-num99.1%
associate-/r/99.3%
clear-num99.3%
Applied egg-rr99.3%
Taylor expanded in a around 0 84.8%
div-sub84.8%
*-inverses84.8%
Simplified84.8%
if -7.20000000000000014e-37 < z < 3.7999999999999997e-43Initial program 94.7%
associate-/l*99.0%
Simplified99.0%
clear-num98.9%
associate-/r/99.0%
clear-num99.0%
Applied egg-rr99.0%
Taylor expanded in z around 0 81.2%
associate-*r/85.9%
Simplified85.9%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e+80) (not (<= z 8.2e-41))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* (/ y a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+80) || !(z <= 8.2e-41)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y / a) * (t - z));
}
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 <= (-2.6d+80)) .or. (.not. (z <= 8.2d-41))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + ((y / a) * (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+80) || !(z <= 8.2e-41)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y / a) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e+80) or not (z <= 8.2e-41): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + ((y / a) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e+80) || !(z <= 8.2e-41)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.6e+80) || ~((z <= 8.2e-41))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + ((y / a) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e+80], N[Not[LessEqual[z, 8.2e-41]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+80} \lor \neg \left(z \leq 8.2 \cdot 10^{-41}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if z < -2.59999999999999982e80 or 8.20000000000000028e-41 < z Initial program 81.9%
associate-/l*99.9%
Simplified99.9%
clear-num99.7%
associate-/r/99.9%
clear-num100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 90.3%
div-sub90.3%
*-inverses90.3%
Simplified90.3%
if -2.59999999999999982e80 < z < 8.20000000000000028e-41Initial program 94.0%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around 0 83.3%
associate-*r/83.3%
neg-mul-183.3%
Simplified83.3%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.85e-37) (not (<= z 5.3e-26))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.85e-37) || !(z <= 5.3e-26)) {
tmp = x + y;
} else {
tmp = x + (t * (y / 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 <= (-2.85d-37)) .or. (.not. (z <= 5.3d-26))) then
tmp = x + y
else
tmp = x + (t * (y / 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 <= -2.85e-37) || !(z <= 5.3e-26)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.85e-37) or not (z <= 5.3e-26): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.85e-37) || !(z <= 5.3e-26)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.85e-37) || ~((z <= 5.3e-26))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.85e-37], N[Not[LessEqual[z, 5.3e-26]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{-37} \lor \neg \left(z \leq 5.3 \cdot 10^{-26}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.84999999999999987e-37 or 5.29999999999999992e-26 < z Initial program 83.9%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in z around inf 75.8%
+-commutative75.8%
Simplified75.8%
if -2.84999999999999987e-37 < z < 5.29999999999999992e-26Initial program 94.9%
associate-/l*99.0%
Simplified99.0%
clear-num98.9%
associate-/r/99.0%
clear-num99.1%
Applied egg-rr99.1%
Taylor expanded in z around 0 80.9%
associate-*r/85.4%
Simplified85.4%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7e-37) (not (<= z 6.5e-6))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7e-37) || !(z <= 6.5e-6)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
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-37)) .or. (.not. (z <= 6.5d-6))) then
tmp = x + y
else
tmp = x + (y / (a / t))
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-37) || !(z <= 6.5e-6)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7e-37) or not (z <= 6.5e-6): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7e-37) || !(z <= 6.5e-6)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7e-37) || ~((z <= 6.5e-6))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e-37], N[Not[LessEqual[z, 6.5e-6]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-37} \lor \neg \left(z \leq 6.5 \cdot 10^{-6}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -7.0000000000000003e-37 or 6.4999999999999996e-6 < z Initial program 83.1%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in z around inf 76.2%
+-commutative76.2%
Simplified76.2%
if -7.0000000000000003e-37 < z < 6.4999999999999996e-6Initial program 95.1%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in z around 0 84.6%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.8e-40) (not (<= z 33.0))) (+ x y) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e-40) || !(z <= 33.0)) {
tmp = x + y;
} else {
tmp = x + (t / (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) :: tmp
if ((z <= (-8.8d-40)) .or. (.not. (z <= 33.0d0))) then
tmp = x + y
else
tmp = x + (t / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e-40) || !(z <= 33.0)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.8e-40) or not (z <= 33.0): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.8e-40) || !(z <= 33.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.8e-40) || ~((z <= 33.0))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.8e-40], N[Not[LessEqual[z, 33.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{-40} \lor \neg \left(z \leq 33\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -8.80000000000000036e-40 or 33 < z Initial program 83.1%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in z around inf 76.2%
+-commutative76.2%
Simplified76.2%
if -8.80000000000000036e-40 < z < 33Initial program 95.1%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
associate-/l*85.2%
Simplified85.2%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - 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 + ((z - t) * (y / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Initial program 88.8%
associate-*l/97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e-106) (not (<= z 3.5e-115))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e-106) || !(z <= 3.5e-115)) {
tmp = x + y;
} 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 ((z <= (-7.2d-106)) .or. (.not. (z <= 3.5d-115))) then
tmp = x + y
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 ((z <= -7.2e-106) || !(z <= 3.5e-115)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e-106) or not (z <= 3.5e-115): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e-106) || !(z <= 3.5e-115)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.2e-106) || ~((z <= 3.5e-115))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e-106], N[Not[LessEqual[z, 3.5e-115]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-106} \lor \neg \left(z \leq 3.5 \cdot 10^{-115}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.20000000000000025e-106 or 3.5000000000000002e-115 < z Initial program 86.1%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around inf 70.2%
+-commutative70.2%
Simplified70.2%
if -7.20000000000000025e-106 < z < 3.5000000000000002e-115Initial program 95.0%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in x around inf 62.8%
Final simplification67.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 88.8%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in x around inf 57.1%
Final simplification57.1%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - 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 = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2023320
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))