
(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 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 99.7%
Final simplification99.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ t (/ (- a z) y)))) (t_2 (+ x (* y (- 1.0 (/ t z))))))
(if (<= z -1.36e+84)
t_2
(if (<= z -7.6e-248)
t_1
(if (<= z 2.7e-171) (+ x (/ y (/ a t))) (if (<= z 0.00062) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t / ((a - z) / y));
double t_2 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -1.36e+84) {
tmp = t_2;
} else if (z <= -7.6e-248) {
tmp = t_1;
} else if (z <= 2.7e-171) {
tmp = x + (y / (a / t));
} else if (z <= 0.00062) {
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 + (t / ((a - z) / y))
t_2 = x + (y * (1.0d0 - (t / z)))
if (z <= (-1.36d+84)) then
tmp = t_2
else if (z <= (-7.6d-248)) then
tmp = t_1
else if (z <= 2.7d-171) then
tmp = x + (y / (a / t))
else if (z <= 0.00062d0) 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 + (t / ((a - z) / y));
double t_2 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -1.36e+84) {
tmp = t_2;
} else if (z <= -7.6e-248) {
tmp = t_1;
} else if (z <= 2.7e-171) {
tmp = x + (y / (a / t));
} else if (z <= 0.00062) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t / ((a - z) / y)) t_2 = x + (y * (1.0 - (t / z))) tmp = 0 if z <= -1.36e+84: tmp = t_2 elif z <= -7.6e-248: tmp = t_1 elif z <= 2.7e-171: tmp = x + (y / (a / t)) elif z <= 0.00062: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t / Float64(Float64(a - z) / y))) t_2 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) tmp = 0.0 if (z <= -1.36e+84) tmp = t_2; elseif (z <= -7.6e-248) tmp = t_1; elseif (z <= 2.7e-171) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 0.00062) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t / ((a - z) / y)); t_2 = x + (y * (1.0 - (t / z))); tmp = 0.0; if (z <= -1.36e+84) tmp = t_2; elseif (z <= -7.6e-248) tmp = t_1; elseif (z <= 2.7e-171) tmp = x + (y / (a / t)); elseif (z <= 0.00062) 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[(t / N[(N[(a - z), $MachinePrecision] / y), $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.36e+84], t$95$2, If[LessEqual[z, -7.6e-248], t$95$1, If[LessEqual[z, 2.7e-171], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00062], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{t}{\frac{a - z}{y}}\\
t_2 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -1.36 \cdot 10^{+84}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-248}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-171}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 0.00062:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.3599999999999999e84 or 6.2e-4 < z Initial program 100.0%
Taylor expanded in a around 0 91.3%
div-sub91.3%
*-inverses91.3%
Simplified91.3%
if -1.3599999999999999e84 < z < -7.5999999999999998e-248 or 2.70000000000000014e-171 < z < 6.2e-4Initial program 99.3%
associate-*r/95.2%
*-commutative95.2%
associate-/l*99.6%
Applied egg-rr99.6%
frac-2neg99.6%
div-inv99.5%
distribute-neg-frac99.5%
Applied egg-rr99.5%
Taylor expanded in t around inf 85.1%
associate-/l*89.5%
Simplified89.5%
if -7.5999999999999998e-248 < z < 2.70000000000000014e-171Initial program 99.7%
Taylor expanded in z around 0 96.4%
+-commutative96.4%
associate-/l*86.3%
associate-/r/99.0%
Simplified99.0%
*-commutative99.0%
clear-num99.0%
un-div-inv99.1%
Applied egg-rr99.1%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e-73) (not (<= z 3.7e-6))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e-73) || !(z <= 3.7e-6)) {
tmp = x + (y * (1.0 - (t / z)));
} 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 <= (-5.2d-73)) .or. (.not. (z <= 3.7d-6))) then
tmp = x + (y * (1.0d0 - (t / z)))
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 <= -5.2e-73) || !(z <= 3.7e-6)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e-73) or not (z <= 3.7e-6): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e-73) || !(z <= 3.7e-6)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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 <= -5.2e-73) || ~((z <= 3.7e-6))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e-73], N[Not[LessEqual[z, 3.7e-6]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-73} \lor \neg \left(z \leq 3.7 \cdot 10^{-6}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -5.2000000000000002e-73 or 3.7000000000000002e-6 < z Initial program 99.9%
Taylor expanded in a around 0 88.2%
div-sub88.2%
*-inverses88.2%
Simplified88.2%
if -5.2000000000000002e-73 < z < 3.7000000000000002e-6Initial program 99.3%
Taylor expanded in z around 0 88.0%
+-commutative88.0%
associate-/l*85.0%
associate-/r/90.3%
Simplified90.3%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -11000000000000.0) (not (<= t 3.7e-10))) (+ x (/ t (/ (- a z) y))) (+ x (* z (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -11000000000000.0) || !(t <= 3.7e-10)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + (z * (y / (z - 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 ((t <= (-11000000000000.0d0)) .or. (.not. (t <= 3.7d-10))) then
tmp = x + (t / ((a - z) / y))
else
tmp = x + (z * (y / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -11000000000000.0) || !(t <= 3.7e-10)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -11000000000000.0) or not (t <= 3.7e-10): tmp = x + (t / ((a - z) / y)) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -11000000000000.0) || !(t <= 3.7e-10)) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -11000000000000.0) || ~((t <= 3.7e-10))) tmp = x + (t / ((a - z) / y)); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -11000000000000.0], N[Not[LessEqual[t, 3.7e-10]], $MachinePrecision]], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -11000000000000 \lor \neg \left(t \leq 3.7 \cdot 10^{-10}\right):\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -1.1e13 or 3.70000000000000015e-10 < t Initial program 99.9%
associate-*r/85.5%
*-commutative85.5%
associate-/l*98.2%
Applied egg-rr98.2%
frac-2neg98.2%
div-inv98.1%
distribute-neg-frac98.1%
Applied egg-rr98.1%
Taylor expanded in t around inf 83.2%
associate-/l*91.8%
Simplified91.8%
if -1.1e13 < t < 3.70000000000000015e-10Initial program 99.4%
Taylor expanded in t around 0 79.5%
+-commutative79.5%
associate-/l*90.7%
Simplified90.7%
associate-/r/88.3%
Applied egg-rr88.3%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+15) (not (<= t 3.1e-6))) (+ x (/ t (/ (- a z) y))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+15) || !(t <= 3.1e-6)) {
tmp = x + (t / ((a - z) / y));
} 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 ((t <= (-1.05d+15)) .or. (.not. (t <= 3.1d-6))) then
tmp = x + (t / ((a - z) / y))
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 ((t <= -1.05e+15) || !(t <= 3.1e-6)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+15) or not (t <= 3.1e-6): tmp = x + (t / ((a - z) / y)) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+15) || !(t <= 3.1e-6)) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); 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 ((t <= -1.05e+15) || ~((t <= 3.1e-6))) tmp = x + (t / ((a - z) / y)); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+15], N[Not[LessEqual[t, 3.1e-6]], $MachinePrecision]], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+15} \lor \neg \left(t \leq 3.1 \cdot 10^{-6}\right):\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -1.05e15 or 3.1e-6 < t Initial program 99.9%
associate-*r/85.5%
*-commutative85.5%
associate-/l*98.2%
Applied egg-rr98.2%
frac-2neg98.2%
div-inv98.1%
distribute-neg-frac98.1%
Applied egg-rr98.1%
Taylor expanded in t around inf 83.2%
associate-/l*91.8%
Simplified91.8%
if -1.05e15 < t < 3.1e-6Initial program 99.4%
Taylor expanded in t around 0 79.5%
+-commutative79.5%
associate-/l*90.7%
Simplified90.7%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.9e+15) (not (<= t 3.1e-9))) (- x (* y (/ t (- z a)))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.9e+15) || !(t <= 3.1e-9)) {
tmp = x - (y * (t / (z - a)));
} 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 ((t <= (-3.9d+15)) .or. (.not. (t <= 3.1d-9))) then
tmp = x - (y * (t / (z - a)))
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 ((t <= -3.9e+15) || !(t <= 3.1e-9)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.9e+15) or not (t <= 3.1e-9): tmp = x - (y * (t / (z - a))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.9e+15) || !(t <= 3.1e-9)) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); 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 ((t <= -3.9e+15) || ~((t <= 3.1e-9))) tmp = x - (y * (t / (z - a))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.9e+15], N[Not[LessEqual[t, 3.1e-9]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(z - a), $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}\;t \leq -3.9 \cdot 10^{+15} \lor \neg \left(t \leq 3.1 \cdot 10^{-9}\right):\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -3.9e15 or 3.10000000000000005e-9 < t Initial program 99.9%
Taylor expanded in t around inf 93.5%
neg-mul-193.5%
distribute-neg-frac93.5%
Simplified93.5%
if -3.9e15 < t < 3.10000000000000005e-9Initial program 99.4%
Taylor expanded in t around 0 79.5%
+-commutative79.5%
associate-/l*90.7%
Simplified90.7%
Final simplification92.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e+84) (not (<= z 0.098))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e+84) || !(z <= 0.098)) {
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 <= (-1d+84)) .or. (.not. (z <= 0.098d0))) 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 <= -1e+84) || !(z <= 0.098)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e+84) or not (z <= 0.098): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e+84) || !(z <= 0.098)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1e+84) || ~((z <= 0.098))) tmp = x + y; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e+84], N[Not[LessEqual[z, 0.098]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+84} \lor \neg \left(z \leq 0.098\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.00000000000000006e84 or 0.098000000000000004 < z Initial program 100.0%
Taylor expanded in z around inf 80.9%
+-commutative80.9%
Simplified80.9%
if -1.00000000000000006e84 < z < 0.098000000000000004Initial program 99.4%
Taylor expanded in z around 0 81.8%
Final simplification81.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.8e+83) (not (<= z 0.000112))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e+83) || !(z <= 0.000112)) {
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 <= (-8.8d+83)) .or. (.not. (z <= 0.000112d0))) 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 <= -8.8e+83) || !(z <= 0.000112)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.8e+83) or not (z <= 0.000112): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.8e+83) || !(z <= 0.000112)) 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 <= -8.8e+83) || ~((z <= 0.000112))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.8e+83], N[Not[LessEqual[z, 0.000112]], $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 -8.8 \cdot 10^{+83} \lor \neg \left(z \leq 0.000112\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -8.79999999999999995e83 or 1.11999999999999998e-4 < z Initial program 100.0%
Taylor expanded in z around inf 80.9%
+-commutative80.9%
Simplified80.9%
if -8.79999999999999995e83 < z < 1.11999999999999998e-4Initial program 99.4%
Taylor expanded in z around 0 81.8%
+-commutative81.8%
associate-/l*80.9%
associate-/r/84.1%
Simplified84.1%
Final simplification82.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e+83) (not (<= z 0.00082))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e+83) || !(z <= 0.00082)) {
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 <= (-9d+83)) .or. (.not. (z <= 0.00082d0))) 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 <= -9e+83) || !(z <= 0.00082)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e+83) or not (z <= 0.00082): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e+83) || !(z <= 0.00082)) 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 <= -9e+83) || ~((z <= 0.00082))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e+83], N[Not[LessEqual[z, 0.00082]], $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 -9 \cdot 10^{+83} \lor \neg \left(z \leq 0.00082\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -8.9999999999999999e83 or 8.1999999999999998e-4 < z Initial program 100.0%
Taylor expanded in z around inf 80.9%
+-commutative80.9%
Simplified80.9%
if -8.9999999999999999e83 < z < 8.1999999999999998e-4Initial program 99.4%
Taylor expanded in z around 0 81.8%
+-commutative81.8%
associate-/l*80.9%
associate-/r/84.1%
Simplified84.1%
*-commutative84.1%
clear-num83.9%
un-div-inv84.6%
Applied egg-rr84.6%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (<= a 2.9e+91) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2.9e+91) {
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 (a <= 2.9d+91) 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 (a <= 2.9e+91) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 2.9e+91: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2.9e+91) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 2.9e+91) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2.9e+91], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.9 \cdot 10^{+91}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 2.90000000000000014e91Initial program 99.9%
Taylor expanded in z around inf 64.3%
+-commutative64.3%
Simplified64.3%
if 2.90000000000000014e91 < a Initial program 98.1%
Taylor expanded in x around inf 67.7%
Final simplification64.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 99.7%
Taylor expanded in x around inf 56.7%
Final simplification56.7%
(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 2024010
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))