
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= (+ x (/ (* y (- z t)) (- z a))) -4e+198) (+ x (* (- z t) (/ y (- z a)))) (+ x (* y (/ (- z t) (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x + ((y * (z - t)) / (z - a))) <= -4e+198) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x + (y * ((z - 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 ((x + ((y * (z - t)) / (z - a))) <= (-4d+198)) then
tmp = x + ((z - t) * (y / (z - a)))
else
tmp = x + (y * ((z - 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 ((x + ((y * (z - t)) / (z - a))) <= -4e+198) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x + (y * ((z - t) / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x + ((y * (z - t)) / (z - a))) <= -4e+198: tmp = x + ((z - t) * (y / (z - a))) else: tmp = x + (y * ((z - t) / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) <= -4e+198) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x + ((y * (z - t)) / (z - a))) <= -4e+198) tmp = x + ((z - t) * (y / (z - a))); else tmp = x + (y * ((z - t) / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -4e+198], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{z - a} \leq -4 \cdot 10^{+198}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))) < -4.00000000000000007e198Initial program 70.2%
associate-*l/99.9%
Simplified99.9%
if -4.00000000000000007e198 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))) Initial program 90.4%
associate-*l/93.4%
Simplified93.4%
Taylor expanded in y around 0 90.4%
associate-*r/99.0%
Simplified99.0%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.55e-99)
(+ x (* (- z t) (/ y z)))
(if (<= z 6e-127)
(+ x (* t (/ y a)))
(if (or (<= z 1.1e-67) (not (<= z 2.7e+112)))
(+ x (* y (- 1.0 (/ t z))))
(+ x (* z (/ y (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e-99) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 6e-127) {
tmp = x + (t * (y / a));
} else if ((z <= 1.1e-67) || !(z <= 2.7e+112)) {
tmp = x + (y * (1.0 - (t / z)));
} 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 (z <= (-1.55d-99)) then
tmp = x + ((z - t) * (y / z))
else if (z <= 6d-127) then
tmp = x + (t * (y / a))
else if ((z <= 1.1d-67) .or. (.not. (z <= 2.7d+112))) then
tmp = x + (y * (1.0d0 - (t / z)))
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 (z <= -1.55e-99) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 6e-127) {
tmp = x + (t * (y / a));
} else if ((z <= 1.1e-67) || !(z <= 2.7e+112)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.55e-99: tmp = x + ((z - t) * (y / z)) elif z <= 6e-127: tmp = x + (t * (y / a)) elif (z <= 1.1e-67) or not (z <= 2.7e+112): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e-99) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); elseif (z <= 6e-127) tmp = Float64(x + Float64(t * Float64(y / a))); elseif ((z <= 1.1e-67) || !(z <= 2.7e+112)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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 (z <= -1.55e-99) tmp = x + ((z - t) * (y / z)); elseif (z <= 6e-127) tmp = x + (t * (y / a)); elseif ((z <= 1.1e-67) || ~((z <= 2.7e+112))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e-99], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-127], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.1e-67], N[Not[LessEqual[z, 2.7e+112]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-99}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-127}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-67} \lor \neg \left(z \leq 2.7 \cdot 10^{+112}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -1.5499999999999999e-99Initial program 77.4%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around inf 81.9%
if -1.5499999999999999e-99 < z < 6.00000000000000017e-127Initial program 93.9%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in z around 0 89.9%
associate-/l*91.1%
associate-/r/91.5%
Applied egg-rr91.5%
if 6.00000000000000017e-127 < z < 1.1000000000000001e-67 or 2.7000000000000001e112 < z Initial program 81.7%
associate-*l/93.0%
Simplified93.0%
Taylor expanded in y around 0 81.7%
associate-*r/98.3%
Simplified98.3%
Taylor expanded in a around 0 93.4%
div-sub93.4%
*-inverses93.4%
Simplified93.4%
if 1.1000000000000001e-67 < z < 2.7000000000000001e112Initial program 92.3%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in t around 0 76.7%
associate-*l/84.4%
*-commutative84.4%
Simplified84.4%
Final simplification87.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.5e+44)
(+ x y)
(if (<= z 3.8e-128)
(+ x (* y (/ t a)))
(if (<= z 8e+136) (- x (* t (/ y z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+44) {
tmp = x + y;
} else if (z <= 3.8e-128) {
tmp = x + (y * (t / a));
} else if (z <= 8e+136) {
tmp = x - (t * (y / z));
} 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 <= (-8.5d+44)) then
tmp = x + y
else if (z <= 3.8d-128) then
tmp = x + (y * (t / a))
else if (z <= 8d+136) then
tmp = x - (t * (y / z))
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 <= -8.5e+44) {
tmp = x + y;
} else if (z <= 3.8e-128) {
tmp = x + (y * (t / a));
} else if (z <= 8e+136) {
tmp = x - (t * (y / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e+44: tmp = x + y elif z <= 3.8e-128: tmp = x + (y * (t / a)) elif z <= 8e+136: tmp = x - (t * (y / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+44) tmp = Float64(x + y); elseif (z <= 3.8e-128) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 8e+136) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.5e+44) tmp = x + y; elseif (z <= 3.8e-128) tmp = x + (y * (t / a)); elseif (z <= 8e+136) tmp = x - (t * (y / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+44], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.8e-128], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+136], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+44}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-128}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+136}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -8.5e44 or 8.00000000000000047e136 < z Initial program 67.8%
associate-*l/95.0%
Simplified95.0%
Taylor expanded in z around inf 85.4%
if -8.5e44 < z < 3.8000000000000002e-128Initial program 95.4%
associate-*l/93.6%
Simplified93.6%
Taylor expanded in y around 0 95.4%
associate-*r/95.5%
Simplified95.5%
Taylor expanded in z around 0 82.4%
associate-*r/83.3%
Simplified83.3%
if 3.8000000000000002e-128 < z < 8.00000000000000047e136Initial program 93.9%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in t around inf 82.0%
associate-*l/81.7%
neg-mul-181.7%
distribute-rgt-neg-out81.7%
Simplified81.7%
distribute-rgt-neg-out81.7%
unsub-neg81.7%
*-commutative81.7%
Applied egg-rr81.7%
Taylor expanded in z around inf 74.9%
*-commutative74.9%
associate-*r/74.6%
Simplified74.6%
Final simplification81.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.2e+48)
(+ x y)
(if (<= z 3.95e-128)
(+ x (* y (/ t a)))
(if (<= z 1.85e+132) (- x (/ (* y t) z)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+48) {
tmp = x + y;
} else if (z <= 3.95e-128) {
tmp = x + (y * (t / a));
} else if (z <= 1.85e+132) {
tmp = x - ((y * t) / z);
} 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.2d+48)) then
tmp = x + y
else if (z <= 3.95d-128) then
tmp = x + (y * (t / a))
else if (z <= 1.85d+132) then
tmp = x - ((y * t) / z)
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.2e+48) {
tmp = x + y;
} else if (z <= 3.95e-128) {
tmp = x + (y * (t / a));
} else if (z <= 1.85e+132) {
tmp = x - ((y * t) / z);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.2e+48: tmp = x + y elif z <= 3.95e-128: tmp = x + (y * (t / a)) elif z <= 1.85e+132: tmp = x - ((y * t) / z) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e+48) tmp = Float64(x + y); elseif (z <= 3.95e-128) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 1.85e+132) tmp = Float64(x - Float64(Float64(y * t) / z)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.2e+48) tmp = x + y; elseif (z <= 3.95e-128) tmp = x + (y * (t / a)); elseif (z <= 1.85e+132) tmp = x - ((y * t) / z); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e+48], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.95e-128], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+132], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+48}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.95 \cdot 10^{-128}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+132}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.2000000000000001e48 or 1.85000000000000005e132 < z Initial program 67.8%
associate-*l/95.0%
Simplified95.0%
Taylor expanded in z around inf 85.4%
if -1.2000000000000001e48 < z < 3.9500000000000001e-128Initial program 95.4%
associate-*l/93.6%
Simplified93.6%
Taylor expanded in y around 0 95.4%
associate-*r/95.5%
Simplified95.5%
Taylor expanded in z around 0 82.4%
associate-*r/83.3%
Simplified83.3%
if 3.9500000000000001e-128 < z < 1.85000000000000005e132Initial program 93.9%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in t around inf 82.0%
associate-*l/81.7%
neg-mul-181.7%
distribute-rgt-neg-out81.7%
Simplified81.7%
distribute-rgt-neg-out81.7%
unsub-neg81.7%
*-commutative81.7%
Applied egg-rr81.7%
Taylor expanded in z around inf 74.9%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.9e-66) (not (<= z 3.7e-123))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e-66) || !(z <= 3.7e-123)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.9d-66)) .or. (.not. (z <= 3.7d-123))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e-66) || !(z <= 3.7e-123)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.9e-66) or not (z <= 3.7e-123): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.9e-66) || !(z <= 3.7e-123)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.9e-66) || ~((z <= 3.7e-123))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.9e-66], N[Not[LessEqual[z, 3.7e-123]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{-66} \lor \neg \left(z \leq 3.7 \cdot 10^{-123}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.89999999999999983e-66 or 3.70000000000000015e-123 < z Initial program 81.2%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in y around 0 81.2%
associate-*r/98.3%
Simplified98.3%
Taylor expanded in a around 0 82.9%
div-sub82.9%
*-inverses82.9%
Simplified82.9%
if -3.89999999999999983e-66 < z < 3.70000000000000015e-123Initial program 94.4%
associate-*l/93.3%
Simplified93.3%
Taylor expanded in z around 0 88.5%
associate-/l*89.6%
associate-/r/89.9%
Applied egg-rr89.9%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.9e+20) (not (<= z 2.1e+109))) (+ x (* y (- 1.0 (/ t z)))) (- x (* t (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.9e+20) || !(z <= 2.1e+109)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x - (t * (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 ((z <= (-2.9d+20)) .or. (.not. (z <= 2.1d+109))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x - (t * (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 ((z <= -2.9e+20) || !(z <= 2.1e+109)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.9e+20) or not (z <= 2.1e+109): tmp = x + (y * (1.0 - (t / z))) else: tmp = x - (t * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.9e+20) || !(z <= 2.1e+109)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.9e+20) || ~((z <= 2.1e+109))) tmp = x + (y * (1.0 - (t / z))); else tmp = x - (t * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.9e+20], N[Not[LessEqual[z, 2.1e+109]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+20} \lor \neg \left(z \leq 2.1 \cdot 10^{+109}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -2.9e20 or 2.1000000000000001e109 < z Initial program 71.1%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in y around 0 71.1%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in a around 0 91.1%
div-sub91.1%
*-inverses91.1%
Simplified91.1%
if -2.9e20 < z < 2.1000000000000001e109Initial program 95.0%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in t around inf 87.9%
associate-*l/88.1%
neg-mul-188.1%
distribute-rgt-neg-out88.1%
Simplified88.1%
distribute-rgt-neg-out88.1%
unsub-neg88.1%
*-commutative88.1%
Applied egg-rr88.1%
Final simplification89.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.14e-97) (+ x (* (- z t) (/ y z))) (if (<= z 2.25e-124) (+ x (* t (/ y a))) (+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.14e-97) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 2.25e-124) {
tmp = x + (t * (y / a));
} else {
tmp = x + (y * (1.0 - (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.14d-97)) then
tmp = x + ((z - t) * (y / z))
else if (z <= 2.25d-124) then
tmp = x + (t * (y / a))
else
tmp = x + (y * (1.0d0 - (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.14e-97) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 2.25e-124) {
tmp = x + (t * (y / a));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.14e-97: tmp = x + ((z - t) * (y / z)) elif z <= 2.25e-124: tmp = x + (t * (y / a)) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.14e-97) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); elseif (z <= 2.25e-124) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.14e-97) tmp = x + ((z - t) * (y / z)); elseif (z <= 2.25e-124) tmp = x + (t * (y / a)); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.14e-97], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e-124], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.14 \cdot 10^{-97}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-124}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -1.14e-97Initial program 77.4%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around inf 81.9%
if -1.14e-97 < z < 2.2499999999999998e-124Initial program 93.9%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in z around 0 89.9%
associate-/l*91.1%
associate-/r/91.5%
Applied egg-rr91.5%
if 2.2499999999999998e-124 < z Initial program 86.0%
associate-*l/94.8%
Simplified94.8%
Taylor expanded in y around 0 86.0%
associate-*r/98.0%
Simplified98.0%
Taylor expanded in a around 0 83.2%
div-sub83.2%
*-inverses83.2%
Simplified83.2%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.75e+45) (+ x y) (if (<= z 6e-113) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e+45) {
tmp = x + y;
} else if (z <= 6e-113) {
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 <= (-1.75d+45)) then
tmp = x + y
else if (z <= 6d-113) 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 <= -1.75e+45) {
tmp = x + y;
} else if (z <= 6e-113) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.75e+45: tmp = x + y elif z <= 6e-113: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e+45) tmp = Float64(x + y); elseif (z <= 6e-113) 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 <= -1.75e+45) tmp = x + y; elseif (z <= 6e-113) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e+45], N[(x + y), $MachinePrecision], If[LessEqual[z, 6e-113], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+45}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-113}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.75000000000000011e45 or 6.0000000000000002e-113 < z Initial program 78.2%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in z around inf 75.7%
if -1.75000000000000011e45 < z < 6.0000000000000002e-113Initial program 95.6%
associate-*l/93.0%
Simplified93.0%
Taylor expanded in y around 0 95.6%
associate-*r/95.6%
Simplified95.6%
Taylor expanded in z around 0 81.3%
associate-*r/82.2%
Simplified82.2%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.7e+48) (+ x y) (if (<= z 2.5e-115) (+ x (* y (/ t a))) (+ x (* z (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+48) {
tmp = x + y;
} else if (z <= 2.5e-115) {
tmp = x + (y * (t / a));
} else {
tmp = x + (z * (y / 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 <= (-3.7d+48)) then
tmp = x + y
else if (z <= 2.5d-115) then
tmp = x + (y * (t / a))
else
tmp = x + (z * (y / 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 <= -3.7e+48) {
tmp = x + y;
} else if (z <= 2.5e-115) {
tmp = x + (y * (t / a));
} else {
tmp = x + (z * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.7e+48: tmp = x + y elif z <= 2.5e-115: tmp = x + (y * (t / a)) else: tmp = x + (z * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e+48) tmp = Float64(x + y); elseif (z <= 2.5e-115) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(z * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.7e+48) tmp = x + y; elseif (z <= 2.5e-115) tmp = x + (y * (t / a)); else tmp = x + (z * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+48], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.5e-115], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+48}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-115}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -3.6999999999999999e48Initial program 66.0%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around inf 82.9%
if -3.6999999999999999e48 < z < 2.5000000000000001e-115Initial program 95.6%
associate-*l/93.0%
Simplified93.0%
Taylor expanded in y around 0 95.6%
associate-*r/95.6%
Simplified95.6%
Taylor expanded in z around 0 81.3%
associate-*r/82.2%
Simplified82.2%
if 2.5000000000000001e-115 < z Initial program 85.6%
associate-*l/95.6%
Simplified95.6%
Taylor expanded in t around 0 67.4%
associate-*l/81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in z around inf 72.0%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.8e+48) (+ x y) (if (<= z 5.5e-90) (+ x (/ y (/ a t))) (+ x (* z (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e+48) {
tmp = x + y;
} else if (z <= 5.5e-90) {
tmp = x + (y / (a / t));
} else {
tmp = x + (z * (y / 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 <= (-6.8d+48)) then
tmp = x + y
else if (z <= 5.5d-90) then
tmp = x + (y / (a / t))
else
tmp = x + (z * (y / 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 <= -6.8e+48) {
tmp = x + y;
} else if (z <= 5.5e-90) {
tmp = x + (y / (a / t));
} else {
tmp = x + (z * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.8e+48: tmp = x + y elif z <= 5.5e-90: tmp = x + (y / (a / t)) else: tmp = x + (z * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e+48) tmp = Float64(x + y); elseif (z <= 5.5e-90) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(z * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.8e+48) tmp = x + y; elseif (z <= 5.5e-90) tmp = x + (y / (a / t)); else tmp = x + (z * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e+48], N[(x + y), $MachinePrecision], If[LessEqual[z, 5.5e-90], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+48}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-90}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -6.8000000000000006e48Initial program 66.0%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around inf 82.9%
if -6.8000000000000006e48 < z < 5.5000000000000003e-90Initial program 95.7%
associate-*l/93.2%
Simplified93.2%
Taylor expanded in z around 0 80.0%
associate-/l*80.8%
Simplified80.8%
if 5.5000000000000003e-90 < z Initial program 85.3%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in t around 0 68.8%
associate-*l/83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in z around inf 73.6%
Final simplification78.8%
(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 85.7%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in y around 0 85.7%
associate-*r/97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.25e+92) x (if (<= a 1.22e+113) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.25e+92) {
tmp = x;
} else if (a <= 1.22e+113) {
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 <= (-1.25d+92)) then
tmp = x
else if (a <= 1.22d+113) 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 <= -1.25e+92) {
tmp = x;
} else if (a <= 1.22e+113) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.25e+92: tmp = x elif a <= 1.22e+113: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.25e+92) tmp = x; elseif (a <= 1.22e+113) 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 <= -1.25e+92) tmp = x; elseif (a <= 1.22e+113) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.25e+92], x, If[LessEqual[a, 1.22e+113], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+92}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.22 \cdot 10^{+113}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.25000000000000005e92 or 1.2199999999999999e113 < a Initial program 84.7%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in x around inf 71.1%
if -1.25000000000000005e92 < a < 1.2199999999999999e113Initial program 86.2%
associate-*l/94.1%
Simplified94.1%
Taylor expanded in z around inf 66.9%
Final simplification68.3%
(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 85.7%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in x around inf 51.8%
Final simplification51.8%
(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 2023274
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))