
(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 12 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) (- t z)))))
double code(double x, double y, double z, double t, double a) {
return x - (y / ((z - a) / (t - z)));
}
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) / (t - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y / ((z - a) / (t - z)));
}
def code(x, y, z, t, a): return x - (y / ((z - a) / (t - z)))
function code(x, y, z, t, a) return Float64(x - Float64(y / Float64(Float64(z - a) / Float64(t - z)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y / ((z - a) / (t - z))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y / N[(N[(z - a), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{\frac{z - a}{t - z}}
\end{array}
Initial program 99.1%
clear-num99.1%
un-div-inv99.1%
Applied egg-rr99.1%
Final simplification99.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.2e-80)
(- x (* y (/ z (- a z))))
(if (<= z 1.4e-54)
(+ x (* y (/ t a)))
(if (<= z 1.8e+52) (+ x (* z (/ y (- z a)))) (+ x (* y (/ (- z t) z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e-80) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 1.4e-54) {
tmp = x + (y * (t / a));
} else if (z <= 1.8e+52) {
tmp = x + (z * (y / (z - a)));
} 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 (z <= (-1.2d-80)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 1.4d-54) then
tmp = x + (y * (t / a))
else if (z <= 1.8d+52) then
tmp = x + (z * (y / (z - a)))
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 (z <= -1.2e-80) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 1.4e-54) {
tmp = x + (y * (t / a));
} else if (z <= 1.8e+52) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.2e-80: tmp = x - (y * (z / (a - z))) elif z <= 1.4e-54: tmp = x + (y * (t / a)) elif z <= 1.8e+52: tmp = x + (z * (y / (z - a))) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e-80) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 1.4e-54) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 1.8e+52) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); 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 (z <= -1.2e-80) tmp = x - (y * (z / (a - z))); elseif (z <= 1.4e-54) tmp = x + (y * (t / a)); elseif (z <= 1.8e+52) tmp = x + (z * (y / (z - a))); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e-80], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-54], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+52], N[(x + N[(z * N[(y / N[(z - a), $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}\;z \leq -1.2 \cdot 10^{-80}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-54}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+52}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -1.2e-80Initial program 99.9%
Taylor expanded in t around 0 70.7%
+-commutative70.7%
associate-/l*89.4%
Simplified89.4%
if -1.2e-80 < z < 1.4000000000000001e-54Initial program 98.2%
Taylor expanded in z around 0 83.2%
*-commutative83.2%
associate-/l*86.4%
Simplified86.4%
if 1.4000000000000001e-54 < z < 1.8e52Initial program 99.9%
Taylor expanded in y around 0 91.0%
*-lft-identity91.0%
associate-*l/91.0%
associate-*r*99.9%
associate-/r/99.9%
associate-*l/99.9%
*-lft-identity99.9%
Simplified99.9%
Taylor expanded in t around 0 77.9%
*-commutative77.9%
associate-*r/82.2%
Simplified82.2%
if 1.8e52 < z Initial program 100.0%
Taylor expanded in a around 0 98.4%
Final simplification88.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) z)))))
(if (<= z -1.45e-85)
t_1
(if (<= z 2.5e-52)
(+ x (* y (/ t a)))
(if (<= z 1.5e+51) (+ x (* z (/ y (- z a)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / z));
double tmp;
if (z <= -1.45e-85) {
tmp = t_1;
} else if (z <= 2.5e-52) {
tmp = x + (y * (t / a));
} else if (z <= 1.5e+51) {
tmp = x + (z * (y / (z - 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) :: tmp
t_1 = x + (y * ((z - t) / z))
if (z <= (-1.45d-85)) then
tmp = t_1
else if (z <= 2.5d-52) then
tmp = x + (y * (t / a))
else if (z <= 1.5d+51) then
tmp = x + (z * (y / (z - 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 - t) / z));
double tmp;
if (z <= -1.45e-85) {
tmp = t_1;
} else if (z <= 2.5e-52) {
tmp = x + (y * (t / a));
} else if (z <= 1.5e+51) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / z)) tmp = 0 if z <= -1.45e-85: tmp = t_1 elif z <= 2.5e-52: tmp = x + (y * (t / a)) elif z <= 1.5e+51: tmp = x + (z * (y / (z - a))) else: tmp = t_1 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 <= -1.45e-85) tmp = t_1; elseif (z <= 2.5e-52) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 1.5e+51) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); else tmp = t_1; 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 <= -1.45e-85) tmp = t_1; elseif (z <= 2.5e-52) tmp = x + (y * (t / a)); elseif (z <= 1.5e+51) tmp = x + (z * (y / (z - 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[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e-85], t$95$1, If[LessEqual[z, 2.5e-52], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+51], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{z}\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-52}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+51}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.4500000000000001e-85 or 1.5e51 < z Initial program 99.9%
Taylor expanded in a around 0 91.6%
if -1.4500000000000001e-85 < z < 2.5e-52Initial program 98.1%
Taylor expanded in z around 0 83.1%
*-commutative83.1%
associate-/l*86.5%
Simplified86.5%
if 2.5e-52 < z < 1.5e51Initial program 99.9%
Taylor expanded in y around 0 91.0%
*-lft-identity91.0%
associate-*l/91.0%
associate-*r*99.9%
associate-/r/99.9%
associate-*l/99.9%
*-lft-identity99.9%
Simplified99.9%
Taylor expanded in t around 0 77.9%
*-commutative77.9%
associate-*r/82.2%
Simplified82.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.1e-70)
(+ x y)
(if (<= z 92000000000000.0)
(+ x (* y (/ t a)))
(if (<= z 2.5e+48) (- x (* z (/ y a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e-70) {
tmp = x + y;
} else if (z <= 92000000000000.0) {
tmp = x + (y * (t / a));
} else if (z <= 2.5e+48) {
tmp = x - (z * (y / 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 <= (-3.1d-70)) then
tmp = x + y
else if (z <= 92000000000000.0d0) then
tmp = x + (y * (t / a))
else if (z <= 2.5d+48) then
tmp = x - (z * (y / 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 <= -3.1e-70) {
tmp = x + y;
} else if (z <= 92000000000000.0) {
tmp = x + (y * (t / a));
} else if (z <= 2.5e+48) {
tmp = x - (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.1e-70: tmp = x + y elif z <= 92000000000000.0: tmp = x + (y * (t / a)) elif z <= 2.5e+48: tmp = x - (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e-70) tmp = Float64(x + y); elseif (z <= 92000000000000.0) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 2.5e+48) tmp = Float64(x - Float64(z * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.1e-70) tmp = x + y; elseif (z <= 92000000000000.0) tmp = x + (y * (t / a)); elseif (z <= 2.5e+48) tmp = x - (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e-70], N[(x + y), $MachinePrecision], If[LessEqual[z, 92000000000000.0], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+48], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-70}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 92000000000000:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+48}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.1e-70 or 2.49999999999999987e48 < z Initial program 99.9%
Taylor expanded in z around inf 82.4%
+-commutative82.4%
Simplified82.4%
if -3.1e-70 < z < 9.2e13Initial program 98.3%
Taylor expanded in z around 0 81.4%
*-commutative81.4%
associate-/l*85.2%
Simplified85.2%
if 9.2e13 < z < 2.49999999999999987e48Initial program 99.9%
Taylor expanded in t around 0 77.8%
+-commutative77.8%
associate-/l*85.0%
Simplified85.0%
Taylor expanded in z around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-/l*84.0%
Simplified84.0%
clear-num84.0%
un-div-inv84.0%
Applied egg-rr84.0%
associate-/r/84.0%
Simplified84.0%
Final simplification83.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.16e-69)
(+ x y)
(if (<= z 1.02e+14)
(+ x (* y (/ t a)))
(if (<= z 8e+48) (- x (* y (/ z a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.16e-69) {
tmp = x + y;
} else if (z <= 1.02e+14) {
tmp = x + (y * (t / a));
} else if (z <= 8e+48) {
tmp = x - (y * (z / 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 <= (-1.16d-69)) then
tmp = x + y
else if (z <= 1.02d+14) then
tmp = x + (y * (t / a))
else if (z <= 8d+48) then
tmp = x - (y * (z / 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 <= -1.16e-69) {
tmp = x + y;
} else if (z <= 1.02e+14) {
tmp = x + (y * (t / a));
} else if (z <= 8e+48) {
tmp = x - (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.16e-69: tmp = x + y elif z <= 1.02e+14: tmp = x + (y * (t / a)) elif z <= 8e+48: tmp = x - (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.16e-69) tmp = Float64(x + y); elseif (z <= 1.02e+14) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 8e+48) tmp = Float64(x - Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.16e-69) tmp = x + y; elseif (z <= 1.02e+14) tmp = x + (y * (t / a)); elseif (z <= 8e+48) tmp = x - (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.16e-69], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.02e+14], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+48], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.16 \cdot 10^{-69}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+14}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+48}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.15999999999999989e-69 or 8.00000000000000035e48 < z Initial program 99.9%
Taylor expanded in z around inf 82.4%
+-commutative82.4%
Simplified82.4%
if -1.15999999999999989e-69 < z < 1.02e14Initial program 98.3%
Taylor expanded in z around 0 81.4%
*-commutative81.4%
associate-/l*85.2%
Simplified85.2%
if 1.02e14 < z < 8.00000000000000035e48Initial program 99.9%
Taylor expanded in t around 0 77.8%
+-commutative77.8%
associate-/l*85.0%
Simplified85.0%
Taylor expanded in z around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-/l*84.0%
Simplified84.0%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.46e-85) (not (<= z 4e-15))) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.46e-85) || !(z <= 4e-15)) {
tmp = x + (y * ((z - 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 <= (-1.46d-85)) .or. (.not. (z <= 4d-15))) then
tmp = x + (y * ((z - 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 <= -1.46e-85) || !(z <= 4e-15)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.46e-85) or not (z <= 4e-15): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.46e-85) || !(z <= 4e-15)) tmp = Float64(x + Float64(y * Float64(Float64(z - 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 <= -1.46e-85) || ~((z <= 4e-15))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.46e-85], N[Not[LessEqual[z, 4e-15]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.46 \cdot 10^{-85} \lor \neg \left(z \leq 4 \cdot 10^{-15}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.46e-85 or 4.0000000000000003e-15 < z Initial program 99.9%
Taylor expanded in a around 0 87.1%
if -1.46e-85 < z < 4.0000000000000003e-15Initial program 98.2%
Taylor expanded in z around 0 82.1%
*-commutative82.1%
associate-/l*86.3%
Simplified86.3%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -8e-65) (- x (* y (/ z (- a z)))) (if (<= z 3.6e+48) (- x (/ y (/ (- z a) t))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e-65) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 3.6e+48) {
tmp = x - (y / ((z - a) / t));
} 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 (z <= (-8d-65)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 3.6d+48) then
tmp = x - (y / ((z - a) / t))
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 (z <= -8e-65) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 3.6e+48) {
tmp = x - (y / ((z - a) / t));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e-65: tmp = x - (y * (z / (a - z))) elif z <= 3.6e+48: tmp = x - (y / ((z - a) / t)) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e-65) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 3.6e+48) tmp = Float64(x - Float64(y / Float64(Float64(z - a) / t))); 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 (z <= -8e-65) tmp = x - (y * (z / (a - z))); elseif (z <= 3.6e+48) tmp = x - (y / ((z - a) / t)); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e-65], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+48], N[(x - N[(y / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-65}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+48}:\\
\;\;\;\;x - \frac{y}{\frac{z - a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -7.99999999999999939e-65Initial program 99.9%
Taylor expanded in t around 0 71.5%
+-commutative71.5%
associate-/l*90.5%
Simplified90.5%
if -7.99999999999999939e-65 < z < 3.59999999999999983e48Initial program 98.5%
clear-num98.4%
un-div-inv98.5%
Applied egg-rr98.5%
Taylor expanded in t around inf 90.2%
mul-1-neg90.2%
distribute-neg-frac290.2%
Simplified90.2%
if 3.59999999999999983e48 < z Initial program 100.0%
Taylor expanded in a around 0 98.4%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.35e-64) (- x (* y (/ z (- a z)))) (if (<= z 6e+48) (+ x (* t (/ y (- a z)))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-64) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 6e+48) {
tmp = x + (t * (y / (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 (z <= (-1.35d-64)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 6d+48) then
tmp = x + (t * (y / (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 (z <= -1.35e-64) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 6e+48) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.35e-64: tmp = x - (y * (z / (a - z))) elif z <= 6e+48: tmp = x + (t * (y / (a - z))) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e-64) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 6e+48) tmp = Float64(x + Float64(t * Float64(y / 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 (z <= -1.35e-64) tmp = x - (y * (z / (a - z))); elseif (z <= 6e+48) tmp = x + (t * (y / (a - z))); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e-64], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+48], N[(x + N[(t * N[(y / 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}\;z \leq -1.35 \cdot 10^{-64}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+48}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -1.34999999999999993e-64Initial program 99.9%
Taylor expanded in t around 0 71.5%
+-commutative71.5%
associate-/l*90.5%
Simplified90.5%
if -1.34999999999999993e-64 < z < 5.9999999999999999e48Initial program 98.5%
clear-num98.4%
un-div-inv98.5%
Applied egg-rr98.5%
Taylor expanded in t around inf 90.2%
mul-1-neg90.2%
distribute-neg-frac290.2%
Simplified90.2%
Taylor expanded in x around 0 86.8%
associate-*r/87.9%
neg-mul-187.9%
distribute-lft-neg-in87.9%
cancel-sign-sub-inv87.9%
Simplified87.9%
if 5.9999999999999999e48 < z Initial program 100.0%
Taylor expanded in a around 0 98.4%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e-69) (not (<= z 1e-54))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e-69) || !(z <= 1e-54)) {
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.85d-69)) .or. (.not. (z <= 1d-54))) 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.85e-69) || !(z <= 1e-54)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e-69) or not (z <= 1e-54): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e-69) || !(z <= 1e-54)) 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.85e-69) || ~((z <= 1e-54))) 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.85e-69], N[Not[LessEqual[z, 1e-54]], $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.85 \cdot 10^{-69} \lor \neg \left(z \leq 10^{-54}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.8500000000000001e-69 or 1e-54 < z Initial program 99.9%
Taylor expanded in z around inf 78.6%
+-commutative78.6%
Simplified78.6%
if -1.8500000000000001e-69 < z < 1e-54Initial program 98.2%
Taylor expanded in z around 0 83.2%
*-commutative83.2%
associate-/l*86.4%
Simplified86.4%
Final simplification82.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.6e-66) (not (<= z 3.6e-54))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.6e-66) || !(z <= 3.6e-54)) {
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 <= (-3.6d-66)) .or. (.not. (z <= 3.6d-54))) 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 <= -3.6e-66) || !(z <= 3.6e-54)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.6e-66) or not (z <= 3.6e-54): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.6e-66) || !(z <= 3.6e-54)) 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 <= -3.6e-66) || ~((z <= 3.6e-54))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.6e-66], N[Not[LessEqual[z, 3.6e-54]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-66} \lor \neg \left(z \leq 3.6 \cdot 10^{-54}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.60000000000000012e-66 or 3.59999999999999976e-54 < z Initial program 99.9%
Taylor expanded in z around inf 79.1%
+-commutative79.1%
Simplified79.1%
if -3.60000000000000012e-66 < z < 3.59999999999999976e-54Initial program 98.2%
Taylor expanded in x around inf 59.2%
Final simplification70.0%
(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.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 99.1%
Taylor expanded in x around inf 55.6%
(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 2024091
(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)))))