
(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 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(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 (* y (/ (- t z) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (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 * ((t - z) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{z - a}
\end{array}
Initial program 83.7%
associate-/l*98.1%
*-commutative98.1%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))) (t_2 (- x (* t (/ y z)))))
(if (<= z -1.3e-39)
t_1
(if (<= z 4e-149)
(+ x (* t (/ y a)))
(if (<= z 1.4e-125)
t_2
(if (<= z 0.00042)
t_1
(if (<= z 7.5e+33)
t_2
(if (<= z 1.5e+112) (+ x (* y (/ t a))) t_1))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double t_2 = x - (t * (y / z));
double tmp;
if (z <= -1.3e-39) {
tmp = t_1;
} else if (z <= 4e-149) {
tmp = x + (t * (y / a));
} else if (z <= 1.4e-125) {
tmp = t_2;
} else if (z <= 0.00042) {
tmp = t_1;
} else if (z <= 7.5e+33) {
tmp = t_2;
} else if (z <= 1.5e+112) {
tmp = x + (y * (t / a));
} 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) :: t_2
real(8) :: tmp
t_1 = x + (y * (z / (z - a)))
t_2 = x - (t * (y / z))
if (z <= (-1.3d-39)) then
tmp = t_1
else if (z <= 4d-149) then
tmp = x + (t * (y / a))
else if (z <= 1.4d-125) then
tmp = t_2
else if (z <= 0.00042d0) then
tmp = t_1
else if (z <= 7.5d+33) then
tmp = t_2
else if (z <= 1.5d+112) then
tmp = x + (y * (t / a))
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 + (y * (z / (z - a)));
double t_2 = x - (t * (y / z));
double tmp;
if (z <= -1.3e-39) {
tmp = t_1;
} else if (z <= 4e-149) {
tmp = x + (t * (y / a));
} else if (z <= 1.4e-125) {
tmp = t_2;
} else if (z <= 0.00042) {
tmp = t_1;
} else if (z <= 7.5e+33) {
tmp = t_2;
} else if (z <= 1.5e+112) {
tmp = x + (y * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) t_2 = x - (t * (y / z)) tmp = 0 if z <= -1.3e-39: tmp = t_1 elif z <= 4e-149: tmp = x + (t * (y / a)) elif z <= 1.4e-125: tmp = t_2 elif z <= 0.00042: tmp = t_1 elif z <= 7.5e+33: tmp = t_2 elif z <= 1.5e+112: tmp = x + (y * (t / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) t_2 = Float64(x - Float64(t * Float64(y / z))) tmp = 0.0 if (z <= -1.3e-39) tmp = t_1; elseif (z <= 4e-149) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 1.4e-125) tmp = t_2; elseif (z <= 0.00042) tmp = t_1; elseif (z <= 7.5e+33) tmp = t_2; elseif (z <= 1.5e+112) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); t_2 = x - (t * (y / z)); tmp = 0.0; if (z <= -1.3e-39) tmp = t_1; elseif (z <= 4e-149) tmp = x + (t * (y / a)); elseif (z <= 1.4e-125) tmp = t_2; elseif (z <= 0.00042) tmp = t_1; elseif (z <= 7.5e+33) tmp = t_2; elseif (z <= 1.5e+112) tmp = x + (y * (t / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e-39], t$95$1, If[LessEqual[z, 4e-149], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-125], t$95$2, If[LessEqual[z, 0.00042], t$95$1, If[LessEqual[z, 7.5e+33], t$95$2, If[LessEqual[z, 1.5e+112], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
t_2 := x - t \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-149}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-125}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 0.00042:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+112}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3e-39 or 1.4e-125 < z < 4.2000000000000002e-4 or 1.4999999999999999e112 < z Initial program 74.6%
Taylor expanded in t around 0 64.4%
associate-/l*86.3%
Simplified86.3%
if -1.3e-39 < z < 3.99999999999999992e-149Initial program 94.6%
Taylor expanded in z around 0 83.1%
+-commutative83.1%
associate-/l*87.8%
Simplified87.8%
if 3.99999999999999992e-149 < z < 1.4e-125 or 4.2000000000000002e-4 < z < 7.50000000000000046e33Initial program 99.7%
associate-/l*99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 89.2%
neg-mul-189.2%
distribute-neg-frac289.2%
sub-neg89.2%
distribute-neg-in89.2%
remove-double-neg89.2%
Simplified89.2%
Taylor expanded in z around inf 81.7%
mul-1-neg81.7%
unsub-neg81.7%
associate-/l*81.6%
Simplified81.6%
if 7.50000000000000046e33 < z < 1.4999999999999999e112Initial program 81.6%
associate-/l*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 87.0%
Final simplification86.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ t a)))))
(if (<= z -4.2e-12)
(+ x y)
(if (<= z 4e-149)
t_1
(if (<= z 7.5e-105)
(* y (/ (- z t) z))
(if (<= z 1.5e+112) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (t / a));
double tmp;
if (z <= -4.2e-12) {
tmp = x + y;
} else if (z <= 4e-149) {
tmp = t_1;
} else if (z <= 7.5e-105) {
tmp = y * ((z - t) / z);
} else if (z <= 1.5e+112) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (y * (t / a))
if (z <= (-4.2d-12)) then
tmp = x + y
else if (z <= 4d-149) then
tmp = t_1
else if (z <= 7.5d-105) then
tmp = y * ((z - t) / z)
else if (z <= 1.5d+112) then
tmp = t_1
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 t_1 = x + (y * (t / a));
double tmp;
if (z <= -4.2e-12) {
tmp = x + y;
} else if (z <= 4e-149) {
tmp = t_1;
} else if (z <= 7.5e-105) {
tmp = y * ((z - t) / z);
} else if (z <= 1.5e+112) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (t / a)) tmp = 0 if z <= -4.2e-12: tmp = x + y elif z <= 4e-149: tmp = t_1 elif z <= 7.5e-105: tmp = y * ((z - t) / z) elif z <= 1.5e+112: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(t / a))) tmp = 0.0 if (z <= -4.2e-12) tmp = Float64(x + y); elseif (z <= 4e-149) tmp = t_1; elseif (z <= 7.5e-105) tmp = Float64(y * Float64(Float64(z - t) / z)); elseif (z <= 1.5e+112) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (t / a)); tmp = 0.0; if (z <= -4.2e-12) tmp = x + y; elseif (z <= 4e-149) tmp = t_1; elseif (z <= 7.5e-105) tmp = y * ((z - t) / z); elseif (z <= 1.5e+112) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e-12], N[(x + y), $MachinePrecision], If[LessEqual[z, 4e-149], t$95$1, If[LessEqual[z, 7.5e-105], N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+112], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{t}{a}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-12}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-105}:\\
\;\;\;\;y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.19999999999999988e-12 or 1.4999999999999999e112 < z Initial program 67.6%
Taylor expanded in z around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -4.19999999999999988e-12 < z < 3.99999999999999992e-149 or 7.5000000000000006e-105 < z < 1.4999999999999999e112Initial program 94.4%
associate-/l*96.5%
*-commutative96.5%
Applied egg-rr96.5%
Taylor expanded in z around 0 80.5%
if 3.99999999999999992e-149 < z < 7.5000000000000006e-105Initial program 99.8%
Taylor expanded in x around 0 74.1%
Taylor expanded in a around 0 61.1%
associate-/l*60.9%
Simplified60.9%
Final simplification78.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.1e-17)
(+ x y)
(if (<= z 4e-149)
(+ x (* t (/ y a)))
(if (<= z 7.5e-105)
(* y (/ (- z t) 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.1e-17) {
tmp = x + y;
} else if (z <= 4e-149) {
tmp = x + (t * (y / a));
} else if (z <= 7.5e-105) {
tmp = y * ((z - t) / 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.1d-17)) then
tmp = x + y
else if (z <= 4d-149) then
tmp = x + (t * (y / a))
else if (z <= 7.5d-105) then
tmp = y * ((z - t) / 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.1e-17) {
tmp = x + y;
} else if (z <= 4e-149) {
tmp = x + (t * (y / a));
} else if (z <= 7.5e-105) {
tmp = y * ((z - t) / 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.1e-17: tmp = x + y elif z <= 4e-149: tmp = x + (t * (y / a)) elif z <= 7.5e-105: tmp = y * ((z - t) / 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.1e-17) tmp = Float64(x + y); elseif (z <= 4e-149) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 7.5e-105) tmp = Float64(y * Float64(Float64(z - t) / 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.1e-17) tmp = x + y; elseif (z <= 4e-149) tmp = x + (t * (y / a)); elseif (z <= 7.5e-105) tmp = y * ((z - t) / 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.1e-17], N[(x + y), $MachinePrecision], If[LessEqual[z, 4e-149], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e-105], N[(y * N[(N[(z - t), $MachinePrecision] / z), $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.1 \cdot 10^{-17}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-149}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-105}:\\
\;\;\;\;y \cdot \frac{z - t}{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.1000000000000003e-17 or 1.4999999999999999e112 < z Initial program 67.6%
Taylor expanded in z around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -5.1000000000000003e-17 < z < 3.99999999999999992e-149Initial program 94.8%
Taylor expanded in z around 0 82.8%
+-commutative82.8%
associate-/l*87.2%
Simplified87.2%
if 3.99999999999999992e-149 < z < 7.5000000000000006e-105Initial program 99.8%
Taylor expanded in x around 0 74.1%
Taylor expanded in a around 0 61.1%
associate-/l*60.9%
Simplified60.9%
if 7.5000000000000006e-105 < z < 1.4999999999999999e112Initial program 93.5%
associate-/l*99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 73.2%
Final simplification80.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.8e-13)
(+ x y)
(if (<= z 4e-149)
(+ x (* t (/ y a)))
(if (<= z 3.2e-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 <= -4.8e-13) {
tmp = x + y;
} else if (z <= 4e-149) {
tmp = x + (t * (y / a));
} else if (z <= 3.2e-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 <= (-4.8d-13)) then
tmp = x + y
else if (z <= 4d-149) then
tmp = x + (t * (y / a))
else if (z <= 3.2d-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 <= -4.8e-13) {
tmp = x + y;
} else if (z <= 4e-149) {
tmp = x + (t * (y / a));
} else if (z <= 3.2e-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 <= -4.8e-13: tmp = x + y elif z <= 4e-149: tmp = x + (t * (y / a)) elif z <= 3.2e-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 <= -4.8e-13) tmp = Float64(x + y); elseif (z <= 4e-149) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 3.2e-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 <= -4.8e-13) tmp = x + y; elseif (z <= 4e-149) tmp = x + (t * (y / a)); elseif (z <= 3.2e-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, -4.8e-13], N[(x + y), $MachinePrecision], If[LessEqual[z, 4e-149], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-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 -4.8 \cdot 10^{-13}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-149}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 3.2 \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 < -4.7999999999999997e-13 or 1.4999999999999999e112 < z Initial program 67.6%
Taylor expanded in z around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -4.7999999999999997e-13 < z < 3.99999999999999992e-149Initial program 94.8%
Taylor expanded in z around 0 82.8%
+-commutative82.8%
associate-/l*87.2%
Simplified87.2%
if 3.99999999999999992e-149 < z < 3.1999999999999998e-125Initial program 99.6%
associate-/l*99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 86.4%
neg-mul-186.4%
distribute-neg-frac286.4%
sub-neg86.4%
distribute-neg-in86.4%
remove-double-neg86.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 3.1999999999999998e-125 < z < 1.4999999999999999e112Initial program 94.5%
associate-/l*99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 68.2%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4800000000000.0) (not (<= z 1.5e+113))) (+ x (* y (/ z (- z a)))) (- x (* y (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4800000000000.0) || !(z <= 1.5e+113)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (y * (t / (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 ((z <= (-4800000000000.0d0)) .or. (.not. (z <= 1.5d+113))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x - (y * (t / (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 ((z <= -4800000000000.0) || !(z <= 1.5e+113)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4800000000000.0) or not (z <= 1.5e+113): tmp = x + (y * (z / (z - a))) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4800000000000.0) || !(z <= 1.5e+113)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4800000000000.0) || ~((z <= 1.5e+113))) tmp = x + (y * (z / (z - a))); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4800000000000.0], N[Not[LessEqual[z, 1.5e+113]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4800000000000 \lor \neg \left(z \leq 1.5 \cdot 10^{+113}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if z < -4.8e12 or 1.5e113 < z Initial program 65.6%
Taylor expanded in t around 0 62.5%
associate-/l*93.1%
Simplified93.1%
if -4.8e12 < z < 1.5e113Initial program 94.6%
associate-/l*97.0%
*-commutative97.0%
Applied egg-rr97.0%
Taylor expanded in t around inf 89.3%
neg-mul-189.3%
distribute-neg-frac289.3%
sub-neg89.3%
distribute-neg-in89.3%
remove-double-neg89.3%
Simplified89.3%
Taylor expanded in t around 0 89.3%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -2850000000000.0) (+ x (* y (/ z (- z a)))) (if (<= z 4.5e+112) (- 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 (z <= -2850000000000.0) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 4.5e+112) {
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 (z <= (-2850000000000.0d0)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 4.5d+112) 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 (z <= -2850000000000.0) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 4.5e+112) {
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 z <= -2850000000000.0: tmp = x + (y * (z / (z - a))) elif z <= 4.5e+112: 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 (z <= -2850000000000.0) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 4.5e+112) 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 (z <= -2850000000000.0) tmp = x + (y * (z / (z - a))); elseif (z <= 4.5e+112) 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[LessEqual[z, -2850000000000.0], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e+112], 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}\;z \leq -2850000000000:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+112}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -2.85e12Initial program 66.7%
Taylor expanded in t around 0 63.4%
associate-/l*93.3%
Simplified93.3%
if -2.85e12 < z < 4.4999999999999999e112Initial program 94.6%
associate-/l*97.0%
*-commutative97.0%
Applied egg-rr97.0%
Taylor expanded in t around inf 89.3%
neg-mul-189.3%
distribute-neg-frac289.3%
sub-neg89.3%
distribute-neg-in89.3%
remove-double-neg89.3%
Simplified89.3%
Taylor expanded in t around 0 89.3%
if 4.4999999999999999e112 < z Initial program 64.0%
Taylor expanded in t around 0 61.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 (- z a)))) (+ 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 / (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 (z <= (-1.05d+14)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 1.05d+113) then
tmp = x - (t * (y / (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 (z <= -1.05e+14) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 1.05e+113) {
tmp = x - (t * (y / (z - a)));
} 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 / (z - a))) 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(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 (z <= -1.05e+14) tmp = x + (y * (z / (z - a))); elseif (z <= 1.05e+113) tmp = x - (t * (y / (z - a))); 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[(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}\;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}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -1.05e14Initial program 66.7%
Taylor expanded in t around 0 63.4%
associate-/l*93.3%
Simplified93.3%
if -1.05e14 < z < 1.0499999999999999e113Initial program 94.6%
Taylor expanded in t around inf 87.0%
mul-1-neg87.0%
associate-/l*90.1%
distribute-rgt-neg-in90.1%
distribute-frac-neg90.1%
Simplified90.1%
if 1.0499999999999999e113 < z Initial program 64.0%
Taylor expanded in t around 0 61.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 (<= x -2.7e-141) x (if (<= x 8.8e-269) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.7e-141) {
tmp = x;
} else if (x <= 8.8e-269) {
tmp = 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 (x <= (-2.7d-141)) then
tmp = x
else if (x <= 8.8d-269) then
tmp = 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 (x <= -2.7e-141) {
tmp = x;
} else if (x <= 8.8e-269) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.7e-141: tmp = x elif x <= 8.8e-269: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.7e-141) tmp = x; elseif (x <= 8.8e-269) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.7e-141) tmp = x; elseif (x <= 8.8e-269) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.7e-141], x, If[LessEqual[x, 8.8e-269], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-141}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{-269}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.7000000000000003e-141 or 8.79999999999999936e-269 < x Initial program 84.3%
Taylor expanded in x around inf 61.8%
if -2.7000000000000003e-141 < x < 8.79999999999999936e-269Initial program 81.2%
Taylor expanded in x around 0 66.7%
Taylor expanded in z around inf 42.7%
Final simplification58.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -9e+128) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9e+128) {
tmp = x;
} 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 (a <= (-9d+128)) then
tmp = x
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 (a <= -9e+128) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9e+128: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9e+128) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9e+128) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9e+128], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{+128}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -9.0000000000000003e128Initial program 77.7%
Taylor expanded in x around inf 71.7%
if -9.0000000000000003e128 < a Initial program 84.9%
Taylor expanded in z around inf 63.5%
+-commutative63.5%
Simplified63.5%
Final simplification64.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 83.7%
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:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))