
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\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) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- a t))))) (if (<= t_1 1e+303) (+ t_1 x) (+ x (* (- z t) (/ y (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= 1e+303) {
tmp = t_1 + x;
} else {
tmp = x + ((z - t) * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * ((z - t) / (a - t))
if (t_1 <= 1d+303) then
tmp = t_1 + x
else
tmp = x + ((z - t) * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= 1e+303) {
tmp = t_1 + x;
} else {
tmp = x + ((z - t) * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (a - t)) tmp = 0 if t_1 <= 1e+303: tmp = t_1 + x else: tmp = x + ((z - t) * (y / (a - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t_1 <= 1e+303) tmp = Float64(t_1 + x); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (a - t)); tmp = 0.0; if (t_1 <= 1e+303) tmp = t_1 + x; else tmp = x + ((z - t) * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+303], N[(t$95$1 + x), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t_1 \leq 10^{+303}:\\
\;\;\;\;t_1 + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < 1e303Initial program 98.7%
if 1e303 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 74.2%
associate-*r/95.0%
Simplified95.0%
associate-/l*74.2%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- a t))))) (if (<= t_1 5e+304) (+ t_1 x) (+ x (* z (/ y (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= 5e+304) {
tmp = t_1 + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * ((z - t) / (a - t))
if (t_1 <= 5d+304) then
tmp = t_1 + x
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= 5e+304) {
tmp = t_1 + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (a - t)) tmp = 0 if t_1 <= 5e+304: tmp = t_1 + x else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t_1 <= 5e+304) tmp = Float64(t_1 + x); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (a - t)); tmp = 0.0; if (t_1 <= 5e+304) tmp = t_1 + x; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+304], N[(t$95$1 + x), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t_1 + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < 4.9999999999999997e304Initial program 98.7%
if 4.9999999999999997e304 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 72.6%
Taylor expanded in z around inf 99.8%
associate-/l*72.6%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.5e-46)
(+ y x)
(if (<= t 4e-79)
(+ x (/ y (/ a z)))
(if (<= t 1.2e+51) (- x (* y (/ z t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e-46) {
tmp = y + x;
} else if (t <= 4e-79) {
tmp = x + (y / (a / z));
} else if (t <= 1.2e+51) {
tmp = x - (y * (z / t));
} else {
tmp = y + 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 (t <= (-5.5d-46)) then
tmp = y + x
else if (t <= 4d-79) then
tmp = x + (y / (a / z))
else if (t <= 1.2d+51) then
tmp = x - (y * (z / t))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e-46) {
tmp = y + x;
} else if (t <= 4e-79) {
tmp = x + (y / (a / z));
} else if (t <= 1.2e+51) {
tmp = x - (y * (z / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e-46: tmp = y + x elif t <= 4e-79: tmp = x + (y / (a / z)) elif t <= 1.2e+51: tmp = x - (y * (z / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e-46) tmp = Float64(y + x); elseif (t <= 4e-79) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 1.2e+51) tmp = Float64(x - Float64(y * Float64(z / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e-46) tmp = y + x; elseif (t <= 4e-79) tmp = x + (y / (a / z)); elseif (t <= 1.2e+51) tmp = x - (y * (z / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e-46], N[(y + x), $MachinePrecision], If[LessEqual[t, 4e-79], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+51], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-46}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-79}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+51}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -5.49999999999999983e-46 or 1.1999999999999999e51 < t Initial program 99.9%
Taylor expanded in t around inf 78.8%
if -5.49999999999999983e-46 < t < 4e-79Initial program 93.7%
Taylor expanded in t around 0 80.1%
associate-/l*84.2%
Simplified84.2%
if 4e-79 < t < 1.1999999999999999e51Initial program 96.4%
Taylor expanded in z around inf 88.4%
Taylor expanded in a around 0 81.5%
associate-*r/81.5%
neg-mul-181.5%
Simplified81.5%
Final simplification81.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.7e-36)
(+ y x)
(if (<= t 2.8e-84)
(+ x (/ y (/ a z)))
(if (<= t 5.2e+49) (- x (/ y (/ t z))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7e-36) {
tmp = y + x;
} else if (t <= 2.8e-84) {
tmp = x + (y / (a / z));
} else if (t <= 5.2e+49) {
tmp = x - (y / (t / z));
} else {
tmp = y + 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 (t <= (-4.7d-36)) then
tmp = y + x
else if (t <= 2.8d-84) then
tmp = x + (y / (a / z))
else if (t <= 5.2d+49) then
tmp = x - (y / (t / z))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7e-36) {
tmp = y + x;
} else if (t <= 2.8e-84) {
tmp = x + (y / (a / z));
} else if (t <= 5.2e+49) {
tmp = x - (y / (t / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.7e-36: tmp = y + x elif t <= 2.8e-84: tmp = x + (y / (a / z)) elif t <= 5.2e+49: tmp = x - (y / (t / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.7e-36) tmp = Float64(y + x); elseif (t <= 2.8e-84) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 5.2e+49) tmp = Float64(x - Float64(y / Float64(t / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.7e-36) tmp = y + x; elseif (t <= 2.8e-84) tmp = x + (y / (a / z)); elseif (t <= 5.2e+49) tmp = x - (y / (t / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.7e-36], N[(y + x), $MachinePrecision], If[LessEqual[t, 2.8e-84], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e+49], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{-36}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-84}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+49}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -4.7000000000000003e-36 or 5.19999999999999977e49 < t Initial program 99.9%
Taylor expanded in t around inf 78.8%
if -4.7000000000000003e-36 < t < 2.79999999999999982e-84Initial program 93.7%
Taylor expanded in t around 0 80.1%
associate-/l*84.2%
Simplified84.2%
if 2.79999999999999982e-84 < t < 5.19999999999999977e49Initial program 96.4%
Taylor expanded in z around inf 88.4%
Taylor expanded in a around 0 81.8%
mul-1-neg81.8%
associate-/l*81.6%
distribute-neg-frac81.6%
Simplified81.6%
Final simplification81.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.7e-36)
(+ y x)
(if (<= t 2e-84)
(+ x (/ y (/ a z)))
(if (<= t 1.15e+52) (- x (/ (* y z) t)) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7e-36) {
tmp = y + x;
} else if (t <= 2e-84) {
tmp = x + (y / (a / z));
} else if (t <= 1.15e+52) {
tmp = x - ((y * z) / t);
} else {
tmp = y + 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 (t <= (-4.7d-36)) then
tmp = y + x
else if (t <= 2d-84) then
tmp = x + (y / (a / z))
else if (t <= 1.15d+52) then
tmp = x - ((y * z) / t)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7e-36) {
tmp = y + x;
} else if (t <= 2e-84) {
tmp = x + (y / (a / z));
} else if (t <= 1.15e+52) {
tmp = x - ((y * z) / t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.7e-36: tmp = y + x elif t <= 2e-84: tmp = x + (y / (a / z)) elif t <= 1.15e+52: tmp = x - ((y * z) / t) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.7e-36) tmp = Float64(y + x); elseif (t <= 2e-84) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 1.15e+52) tmp = Float64(x - Float64(Float64(y * z) / t)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.7e-36) tmp = y + x; elseif (t <= 2e-84) tmp = x + (y / (a / z)); elseif (t <= 1.15e+52) tmp = x - ((y * z) / t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.7e-36], N[(y + x), $MachinePrecision], If[LessEqual[t, 2e-84], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e+52], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{-36}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-84}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+52}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -4.7000000000000003e-36 or 1.15e52 < t Initial program 99.9%
Taylor expanded in t around inf 78.8%
if -4.7000000000000003e-36 < t < 2.0000000000000001e-84Initial program 93.7%
Taylor expanded in t around 0 80.1%
associate-/l*84.2%
Simplified84.2%
if 2.0000000000000001e-84 < t < 1.15e52Initial program 96.4%
Taylor expanded in z around inf 88.7%
associate-/l*88.5%
associate-/r/92.0%
Applied egg-rr92.0%
Taylor expanded in a around 0 81.8%
associate-*r/81.8%
neg-mul-181.8%
distribute-rgt-neg-in81.8%
Simplified81.8%
Final simplification81.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.2e-38) (not (<= t 3.1e-83))) (+ x (* y (- 1.0 (/ z t)))) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e-38) || !(t <= 3.1e-83)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.2d-38)) .or. (.not. (t <= 3.1d-83))) then
tmp = x + (y * (1.0d0 - (z / t)))
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e-38) || !(t <= 3.1e-83)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.2e-38) or not (t <= 3.1e-83): tmp = x + (y * (1.0 - (z / t))) else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.2e-38) || !(t <= 3.1e-83)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.2e-38) || ~((t <= 3.1e-83))) tmp = x + (y * (1.0 - (z / t))); else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.2e-38], N[Not[LessEqual[t, 3.1e-83]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-38} \lor \neg \left(t \leq 3.1 \cdot 10^{-83}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.20000000000000026e-38 or 3.09999999999999992e-83 < t Initial program 99.3%
Taylor expanded in a around 0 87.0%
associate-*r/87.0%
neg-mul-187.0%
Simplified87.0%
Taylor expanded in z around 0 87.0%
mul-1-neg87.0%
unsub-neg87.0%
Simplified87.0%
if -4.20000000000000026e-38 < t < 3.09999999999999992e-83Initial program 93.7%
Taylor expanded in t around 0 80.1%
associate-/l*84.2%
Simplified84.2%
Final simplification85.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.7e-36) (not (<= t 2.75e-13))) (+ x (* y (- 1.0 (/ z t)))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.7e-36) || !(t <= 2.75e-13)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.7d-36)) .or. (.not. (t <= 2.75d-13))) then
tmp = x + (y * (1.0d0 - (z / t)))
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.7e-36) || !(t <= 2.75e-13)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.7e-36) or not (t <= 2.75e-13): tmp = x + (y * (1.0 - (z / t))) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.7e-36) || !(t <= 2.75e-13)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.7e-36) || ~((t <= 2.75e-13))) tmp = x + (y * (1.0 - (z / t))); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.7e-36], N[Not[LessEqual[t, 2.75e-13]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{-36} \lor \neg \left(t \leq 2.75 \cdot 10^{-13}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -4.7000000000000003e-36 or 2.74999999999999989e-13 < t Initial program 99.9%
Taylor expanded in a around 0 89.6%
associate-*r/89.6%
neg-mul-189.6%
Simplified89.6%
Taylor expanded in z around 0 89.6%
mul-1-neg89.6%
unsub-neg89.6%
Simplified89.6%
if -4.7000000000000003e-36 < t < 2.74999999999999989e-13Initial program 93.7%
Taylor expanded in z around inf 89.7%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.6e-42) (not (<= t 2.7e-13))) (+ x (* y (- 1.0 (/ z t)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e-42) || !(t <= 2.7e-13)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.6d-42)) .or. (.not. (t <= 2.7d-13))) then
tmp = x + (y * (1.0d0 - (z / t)))
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e-42) || !(t <= 2.7e-13)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.6e-42) or not (t <= 2.7e-13): tmp = x + (y * (1.0 - (z / t))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.6e-42) || !(t <= 2.7e-13)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.6e-42) || ~((t <= 2.7e-13))) tmp = x + (y * (1.0 - (z / t))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.6e-42], N[Not[LessEqual[t, 2.7e-13]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-42} \lor \neg \left(t \leq 2.7 \cdot 10^{-13}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -3.6000000000000002e-42 or 2.70000000000000011e-13 < t Initial program 99.9%
Taylor expanded in a around 0 89.6%
associate-*r/89.6%
neg-mul-189.6%
Simplified89.6%
Taylor expanded in z around 0 89.6%
mul-1-neg89.6%
unsub-neg89.6%
Simplified89.6%
if -3.6000000000000002e-42 < t < 2.70000000000000011e-13Initial program 93.7%
Taylor expanded in z around inf 89.6%
associate-/l*90.2%
associate-/r/92.8%
Applied egg-rr92.8%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.4e-37) (not (<= t 3.2e-13))) (+ y x) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.4e-37) || !(t <= 3.2e-13)) {
tmp = y + x;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-7.4d-37)) .or. (.not. (t <= 3.2d-13))) then
tmp = y + x
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.4e-37) || !(t <= 3.2e-13)) {
tmp = y + x;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.4e-37) or not (t <= 3.2e-13): tmp = y + x else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.4e-37) || !(t <= 3.2e-13)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.4e-37) || ~((t <= 3.2e-13))) tmp = y + x; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.4e-37], N[Not[LessEqual[t, 3.2e-13]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{-37} \lor \neg \left(t \leq 3.2 \cdot 10^{-13}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -7.4e-37 or 3.2e-13 < t Initial program 99.9%
Taylor expanded in t around inf 75.8%
if -7.4e-37 < t < 3.2e-13Initial program 93.7%
Taylor expanded in t around 0 80.8%
Final simplification78.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.22e-40) (not (<= t 2e-13))) (+ y x) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.22e-40) || !(t <= 2e-13)) {
tmp = y + x;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.22d-40)) .or. (.not. (t <= 2d-13))) then
tmp = y + x
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.22e-40) || !(t <= 2e-13)) {
tmp = y + x;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.22e-40) or not (t <= 2e-13): tmp = y + x else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.22e-40) || !(t <= 2e-13)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.22e-40) || ~((t <= 2e-13))) tmp = y + x; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.22e-40], N[Not[LessEqual[t, 2e-13]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{-40} \lor \neg \left(t \leq 2 \cdot 10^{-13}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.22e-40 or 2.0000000000000001e-13 < t Initial program 99.9%
Taylor expanded in t around inf 75.8%
if -1.22e-40 < t < 2.0000000000000001e-13Initial program 93.7%
Taylor expanded in t around 0 77.8%
associate-/l*81.3%
Simplified81.3%
Final simplification78.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1e-126) (not (<= t 4.4e+31))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e-126) || !(t <= 4.4e+31)) {
tmp = y + x;
} 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 ((t <= (-1d-126)) .or. (.not. (t <= 4.4d+31))) then
tmp = y + x
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 ((t <= -1e-126) || !(t <= 4.4e+31)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1e-126) or not (t <= 4.4e+31): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1e-126) || !(t <= 4.4e+31)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1e-126) || ~((t <= 4.4e+31))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1e-126], N[Not[LessEqual[t, 4.4e+31]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-126} \lor \neg \left(t \leq 4.4 \cdot 10^{+31}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -9.9999999999999995e-127 or 4.4000000000000002e31 < t Initial program 99.9%
Taylor expanded in t around inf 72.8%
if -9.9999999999999995e-127 < t < 4.4000000000000002e31Initial program 93.0%
Taylor expanded in z around 0 48.8%
mul-1-neg48.8%
associate-/l*54.0%
distribute-neg-frac54.0%
Simplified54.0%
Taylor expanded in x around inf 46.9%
Final simplification61.8%
(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 97.0%
Taylor expanded in z around 0 57.7%
mul-1-neg57.7%
associate-/l*65.5%
distribute-neg-frac65.5%
Simplified65.5%
Taylor expanded in x around inf 44.0%
Final simplification44.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} 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) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
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) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); 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] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023333
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))