
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - 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 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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(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}
Initial program 98.1%
clear-num98.1%
un-div-inv98.1%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) z)))))
(if (<= z -2.4e-38)
t_1
(if (<= z 4e-149)
(+ x (* t (/ y a)))
(if (or (<= z 1.06e-104) (not (<= z 8.6e-36)))
t_1
(+ x (* y (/ t a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / z));
double tmp;
if (z <= -2.4e-38) {
tmp = t_1;
} else if (z <= 4e-149) {
tmp = x + (t * (y / a));
} else if ((z <= 1.06e-104) || !(z <= 8.6e-36)) {
tmp = t_1;
} else {
tmp = x + (y * (t / 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 = x + (y * ((z - t) / z))
if (z <= (-2.4d-38)) then
tmp = t_1
else if (z <= 4d-149) then
tmp = x + (t * (y / a))
else if ((z <= 1.06d-104) .or. (.not. (z <= 8.6d-36))) then
tmp = t_1
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / z));
double tmp;
if (z <= -2.4e-38) {
tmp = t_1;
} else if (z <= 4e-149) {
tmp = x + (t * (y / a));
} else if ((z <= 1.06e-104) || !(z <= 8.6e-36)) {
tmp = t_1;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / z)) tmp = 0 if z <= -2.4e-38: tmp = t_1 elif z <= 4e-149: tmp = x + (t * (y / a)) elif (z <= 1.06e-104) or not (z <= 8.6e-36): tmp = t_1 else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / z))) tmp = 0.0 if (z <= -2.4e-38) tmp = t_1; elseif (z <= 4e-149) tmp = Float64(x + Float64(t * Float64(y / a))); elseif ((z <= 1.06e-104) || !(z <= 8.6e-36)) tmp = t_1; else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / z)); tmp = 0.0; if (z <= -2.4e-38) tmp = t_1; elseif (z <= 4e-149) tmp = x + (t * (y / a)); elseif ((z <= 1.06e-104) || ~((z <= 8.6e-36))) tmp = t_1; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e-38], t$95$1, If[LessEqual[z, 4e-149], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.06e-104], N[Not[LessEqual[z, 8.6e-36]], $MachinePrecision]], t$95$1, N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{z}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-149}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-104} \lor \neg \left(z \leq 8.6 \cdot 10^{-36}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.40000000000000022e-38 or 3.99999999999999992e-149 < z < 1.06e-104 or 8.6000000000000004e-36 < z Initial program 99.9%
Taylor expanded in a around 0 82.1%
if -2.40000000000000022e-38 < z < 3.99999999999999992e-149Initial program 94.6%
Taylor expanded in z around 0 83.1%
+-commutative83.1%
associate-/l*87.8%
Simplified87.8%
if 1.06e-104 < z < 8.6000000000000004e-36Initial program 99.8%
Taylor expanded in z around 0 85.7%
*-commutative85.7%
associate-/l*85.7%
Simplified85.7%
Final simplification84.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.3e-11)
(+ x y)
(if (<= z 4e-149)
(+ x (* t (/ y a)))
(if (<= z 1.7e-125)
(- x (* t (/ y z)))
(if (<= z 1.5e+112) (+ x (* y (/ t a))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.3e-11) {
tmp = x + y;
} else if (z <= 4e-149) {
tmp = x + (t * (y / a));
} else if (z <= 1.7e-125) {
tmp = x - (t * (y / z));
} else if (z <= 1.5e+112) {
tmp = x + (y * (t / a));
} else {
tmp = x + 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 <= (-5.3d-11)) then
tmp = x + y
else if (z <= 4d-149) then
tmp = x + (t * (y / a))
else if (z <= 1.7d-125) then
tmp = x - (t * (y / z))
else if (z <= 1.5d+112) then
tmp = x + (y * (t / a))
else
tmp = x + 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 <= -5.3e-11) {
tmp = x + y;
} else if (z <= 4e-149) {
tmp = x + (t * (y / a));
} else if (z <= 1.7e-125) {
tmp = x - (t * (y / z));
} else if (z <= 1.5e+112) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.3e-11: tmp = x + y elif z <= 4e-149: tmp = x + (t * (y / a)) elif z <= 1.7e-125: tmp = x - (t * (y / z)) elif z <= 1.5e+112: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.3e-11) tmp = Float64(x + y); elseif (z <= 4e-149) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 1.7e-125) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 1.5e+112) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.3e-11) tmp = x + y; elseif (z <= 4e-149) tmp = x + (t * (y / a)); elseif (z <= 1.7e-125) tmp = x - (t * (y / z)); elseif (z <= 1.5e+112) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.3e-11], N[(x + y), $MachinePrecision], If[LessEqual[z, 4e-149], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-125], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+112], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{-11}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-149}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-125}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+112}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.2999999999999998e-11 or 1.4999999999999999e112 < z Initial program 99.9%
Taylor expanded in z around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -5.2999999999999998e-11 < z < 3.99999999999999992e-149Initial program 94.9%
Taylor expanded in z around 0 82.8%
+-commutative82.8%
associate-/l*87.2%
Simplified87.2%
if 3.99999999999999992e-149 < z < 1.69999999999999988e-125Initial program 99.8%
Taylor expanded in t around inf 86.4%
associate-*r/86.4%
mul-1-neg86.4%
distribute-rgt-neg-in86.4%
associate-*r/86.4%
Simplified86.4%
Taylor expanded in z around inf 85.9%
mul-1-neg85.9%
unsub-neg85.9%
associate-/l*85.9%
Simplified85.9%
if 1.69999999999999988e-125 < z < 1.4999999999999999e112Initial program 99.9%
Taylor expanded in z around 0 62.8%
*-commutative62.8%
associate-/l*68.2%
Simplified68.2%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.9e+19) (not (<= a 1150000000.0))) (- x (* y (/ z (- a z)))) (+ x (* y (/ (- z t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.9e+19) || !(a <= 1150000000.0)) {
tmp = x - (y * (z / (a - z)));
} else {
tmp = x + (y * ((z - 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 ((a <= (-6.9d+19)) .or. (.not. (a <= 1150000000.0d0))) then
tmp = x - (y * (z / (a - z)))
else
tmp = x + (y * ((z - 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 ((a <= -6.9e+19) || !(a <= 1150000000.0)) {
tmp = x - (y * (z / (a - z)));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.9e+19) or not (a <= 1150000000.0): tmp = x - (y * (z / (a - z))) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.9e+19) || !(a <= 1150000000.0)) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6.9e+19) || ~((a <= 1150000000.0))) tmp = x - (y * (z / (a - z))); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.9e+19], N[Not[LessEqual[a, 1150000000.0]], $MachinePrecision]], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.9 \cdot 10^{+19} \lor \neg \left(a \leq 1150000000\right):\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if a < -6.9e19 or 1.15e9 < a Initial program 99.9%
Taylor expanded in t around 0 68.8%
+-commutative68.8%
associate-/l*82.3%
Simplified82.3%
if -6.9e19 < a < 1.15e9Initial program 96.1%
Taylor expanded in a around 0 85.0%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2850000000000.0) (- x (* y (/ z (- a z)))) (if (<= z 4.5e+112) (+ x (* y (/ t (- a z)))) (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2850000000000.0) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 4.5e+112) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y / ((z - a) / 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 <= (-2850000000000.0d0)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 4.5d+112) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y / ((z - a) / 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 <= -2850000000000.0) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 4.5e+112) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2850000000000.0: tmp = x - (y * (z / (a - z))) elif z <= 4.5e+112: tmp = x + (y * (t / (a - z))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2850000000000.0) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 4.5e+112) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2850000000000.0) tmp = x - (y * (z / (a - z))); elseif (z <= 4.5e+112) tmp = x + (y * (t / (a - z))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2850000000000.0], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e+112], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2850000000000:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+112}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -2.85e12Initial program 100.0%
Taylor expanded in t around 0 63.4%
+-commutative63.4%
associate-/l*93.3%
Simplified93.3%
if -2.85e12 < z < 4.4999999999999999e112Initial program 97.0%
Taylor expanded in t around inf 87.0%
associate-*r/87.0%
mul-1-neg87.0%
distribute-rgt-neg-in87.0%
associate-*r/90.1%
Simplified90.1%
Taylor expanded in x around 0 87.0%
mul-1-neg87.0%
*-commutative87.0%
associate-/l*89.3%
distribute-lft-neg-in89.3%
cancel-sign-sub-inv89.3%
Simplified89.3%
if 4.4999999999999999e112 < z Initial program 99.8%
Taylor expanded in t around 0 61.3%
+-commutative61.3%
associate-/l*92.9%
Simplified92.9%
clear-num92.9%
un-div-inv92.9%
Applied egg-rr92.9%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.05e+14) (+ x (* y (/ z (- z a)))) (if (<= z 1.05e+113) (+ x (* t (/ y (- a z)))) (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+14) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 1.05e+113) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - a) / 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 <= (-1.05d+14)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 1.05d+113) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y / ((z - a) / 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 <= -1.05e+14) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 1.05e+113) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+14: tmp = x + (y * (z / (z - a))) elif z <= 1.05e+113: tmp = x + (t * (y / (a - z))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+14) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 1.05e+113) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e+14) tmp = x + (y * (z / (z - a))); elseif (z <= 1.05e+113) tmp = x + (t * (y / (a - z))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+14], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+113], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+14}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+113}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -1.05e14Initial program 100.0%
Taylor expanded in t around 0 63.4%
+-commutative63.4%
associate-/l*93.3%
Simplified93.3%
if -1.05e14 < z < 1.0499999999999999e113Initial program 97.0%
Taylor expanded in t around inf 87.0%
associate-*r/87.0%
mul-1-neg87.0%
distribute-rgt-neg-in87.0%
associate-*r/90.1%
Simplified90.1%
if 1.0499999999999999e113 < z Initial program 99.8%
Taylor expanded in t around 0 61.3%
+-commutative61.3%
associate-/l*92.9%
Simplified92.9%
clear-num92.9%
un-div-inv92.9%
Applied egg-rr92.9%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e-10) (not (<= z 1.5e+112))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e-10) || !(z <= 1.5e+112)) {
tmp = x + y;
} else {
tmp = x + (y * (t / 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.9d-10)) .or. (.not. (z <= 1.5d+112))) then
tmp = x + y
else
tmp = x + (y * (t / 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.9e-10) || !(z <= 1.5e+112)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e-10) or not (z <= 1.5e+112): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e-10) || !(z <= 1.5e+112)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e-10) || ~((z <= 1.5e+112))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e-10], N[Not[LessEqual[z, 1.5e+112]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-10} \lor \neg \left(z \leq 1.5 \cdot 10^{+112}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.8999999999999999e-10 or 1.4999999999999999e112 < z Initial program 99.9%
Taylor expanded in z around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -1.8999999999999999e-10 < z < 1.4999999999999999e112Initial program 96.8%
Taylor expanded in z around 0 73.0%
*-commutative73.0%
associate-/l*75.6%
Simplified75.6%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e-17) (not (<= z 5.2e+87))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e-17) || !(z <= 5.2e+87)) {
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.6d-17)) .or. (.not. (z <= 5.2d+87))) 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.6e-17) || !(z <= 5.2e+87)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e-17) or not (z <= 5.2e+87): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e-17) || !(z <= 5.2e+87)) 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.6e-17) || ~((z <= 5.2e+87))) 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.6e-17], N[Not[LessEqual[z, 5.2e+87]], $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.6 \cdot 10^{-17} \lor \neg \left(z \leq 5.2 \cdot 10^{+87}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.60000000000000003e-17 or 5.19999999999999997e87 < z Initial program 99.9%
Taylor expanded in z around inf 78.7%
+-commutative78.7%
Simplified78.7%
if -2.60000000000000003e-17 < z < 5.19999999999999997e87Initial program 96.7%
Taylor expanded in z around 0 73.2%
+-commutative73.2%
associate-/l*77.3%
Simplified77.3%
Final simplification77.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.5e-6) (not (<= z 2.6e-123))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e-6) || !(z <= 2.6e-123)) {
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 <= (-6.5d-6)) .or. (.not. (z <= 2.6d-123))) 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 <= -6.5e-6) || !(z <= 2.6e-123)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.5e-6) or not (z <= 2.6e-123): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.5e-6) || !(z <= 2.6e-123)) 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 <= -6.5e-6) || ~((z <= 2.6e-123))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.5e-6], N[Not[LessEqual[z, 2.6e-123]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-6} \lor \neg \left(z \leq 2.6 \cdot 10^{-123}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.4999999999999996e-6 or 2.59999999999999995e-123 < z Initial program 99.9%
Taylor expanded in z around inf 72.0%
+-commutative72.0%
Simplified72.0%
if -6.4999999999999996e-6 < z < 2.59999999999999995e-123Initial program 95.3%
Taylor expanded in x around inf 58.7%
Final simplification66.7%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.1%
Final simplification98.1%
(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 98.1%
Taylor expanded in x around inf 53.9%
Final simplification53.9%
(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 2024059
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))