
(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 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.4e+167)
(+ x y)
(if (<= z -1.15e+30)
(- x (* t (/ y z)))
(if (or (<= z -1.32e-45) (not (<= z 1.2e+36)))
(+ x y)
(+ x (* y (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.4e+167) {
tmp = x + y;
} else if (z <= -1.15e+30) {
tmp = x - (t * (y / z));
} else if ((z <= -1.32e-45) || !(z <= 1.2e+36)) {
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 <= (-6.4d+167)) then
tmp = x + y
else if (z <= (-1.15d+30)) then
tmp = x - (t * (y / z))
else if ((z <= (-1.32d-45)) .or. (.not. (z <= 1.2d+36))) 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 <= -6.4e+167) {
tmp = x + y;
} else if (z <= -1.15e+30) {
tmp = x - (t * (y / z));
} else if ((z <= -1.32e-45) || !(z <= 1.2e+36)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.4e+167: tmp = x + y elif z <= -1.15e+30: tmp = x - (t * (y / z)) elif (z <= -1.32e-45) or not (z <= 1.2e+36): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.4e+167) tmp = Float64(x + y); elseif (z <= -1.15e+30) tmp = Float64(x - Float64(t * Float64(y / z))); elseif ((z <= -1.32e-45) || !(z <= 1.2e+36)) 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 <= -6.4e+167) tmp = x + y; elseif (z <= -1.15e+30) tmp = x - (t * (y / z)); elseif ((z <= -1.32e-45) || ~((z <= 1.2e+36))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.4e+167], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.15e+30], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.32e-45], N[Not[LessEqual[z, 1.2e+36]], $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 -6.4 \cdot 10^{+167}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{+30}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -1.32 \cdot 10^{-45} \lor \neg \left(z \leq 1.2 \cdot 10^{+36}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -6.39999999999999962e167 or -1.15e30 < z < -1.32000000000000005e-45 or 1.19999999999999996e36 < z Initial program 99.9%
Taylor expanded in z around inf 80.7%
if -6.39999999999999962e167 < z < -1.15e30Initial program 100.0%
Taylor expanded in a around 0 80.5%
Taylor expanded in z around 0 73.4%
associate-*r/73.4%
mul-1-neg73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
associate-/l*76.3%
distribute-neg-frac76.3%
distribute-neg-frac276.3%
Simplified76.3%
Taylor expanded in x around 0 73.4%
mul-1-neg73.4%
*-commutative73.4%
sub-neg73.4%
*-commutative73.4%
associate-/l*76.3%
Simplified76.3%
if -1.32000000000000005e-45 < z < 1.19999999999999996e36Initial program 99.2%
Taylor expanded in z around 0 84.9%
*-commutative84.9%
associate-/l*84.9%
Simplified84.9%
Final simplification82.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) z)))))
(if (<= z -1.85e-45)
t_1
(if (<= z 5.4e-146)
(+ x (* y (/ t a)))
(if (<= z 1.55e+31) (+ x (* y (/ z (- 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.85e-45) {
tmp = t_1;
} else if (z <= 5.4e-146) {
tmp = x + (y * (t / a));
} else if (z <= 1.55e+31) {
tmp = x + (y * (z / (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.85d-45)) then
tmp = t_1
else if (z <= 5.4d-146) then
tmp = x + (y * (t / a))
else if (z <= 1.55d+31) then
tmp = x + (y * (z / (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.85e-45) {
tmp = t_1;
} else if (z <= 5.4e-146) {
tmp = x + (y * (t / a));
} else if (z <= 1.55e+31) {
tmp = x + (y * (z / (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.85e-45: tmp = t_1 elif z <= 5.4e-146: tmp = x + (y * (t / a)) elif z <= 1.55e+31: tmp = x + (y * (z / (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.85e-45) tmp = t_1; elseif (z <= 5.4e-146) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 1.55e+31) tmp = Float64(x + Float64(y * Float64(z / 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.85e-45) tmp = t_1; elseif (z <= 5.4e-146) tmp = x + (y * (t / a)); elseif (z <= 1.55e+31) tmp = x + (y * (z / (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.85e-45], t$95$1, If[LessEqual[z, 5.4e-146], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+31], N[(x + N[(y * N[(z / 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.85 \cdot 10^{-45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-146}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+31}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.85e-45 or 1.5500000000000001e31 < z Initial program 99.9%
Taylor expanded in a around 0 88.5%
if -1.85e-45 < z < 5.3999999999999999e-146Initial program 99.0%
Taylor expanded in z around 0 90.6%
*-commutative90.6%
associate-/l*90.7%
Simplified90.7%
if 5.3999999999999999e-146 < z < 1.5500000000000001e31Initial program 100.0%
Taylor expanded in t around 0 85.6%
associate-/l*85.7%
Simplified85.7%
Final simplification88.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) z)))))
(if (<= z -3.6e-46)
t_1
(if (<= z 2.15e-154)
(+ x (* y (/ t a)))
(if (<= z 5.8e+35) (+ 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 <= -3.6e-46) {
tmp = t_1;
} else if (z <= 2.15e-154) {
tmp = x + (y * (t / a));
} else if (z <= 5.8e+35) {
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 <= (-3.6d-46)) then
tmp = t_1
else if (z <= 2.15d-154) then
tmp = x + (y * (t / a))
else if (z <= 5.8d+35) 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 <= -3.6e-46) {
tmp = t_1;
} else if (z <= 2.15e-154) {
tmp = x + (y * (t / a));
} else if (z <= 5.8e+35) {
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 <= -3.6e-46: tmp = t_1 elif z <= 2.15e-154: tmp = x + (y * (t / a)) elif z <= 5.8e+35: 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 <= -3.6e-46) tmp = t_1; elseif (z <= 2.15e-154) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 5.8e+35) 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 <= -3.6e-46) tmp = t_1; elseif (z <= 2.15e-154) tmp = x + (y * (t / a)); elseif (z <= 5.8e+35) 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, -3.6e-46], t$95$1, If[LessEqual[z, 2.15e-154], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+35], 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 -3.6 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-154}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+35}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.6e-46 or 5.79999999999999989e35 < z Initial program 99.9%
Taylor expanded in a around 0 88.5%
if -3.6e-46 < z < 2.14999999999999996e-154Initial program 98.9%
Taylor expanded in z around 0 90.4%
*-commutative90.4%
associate-/l*91.5%
Simplified91.5%
if 2.14999999999999996e-154 < z < 5.79999999999999989e35Initial program 100.0%
Taylor expanded in t around 0 84.2%
*-commutative84.2%
associate-/l*86.8%
Applied egg-rr86.8%
Final simplification89.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e-56) (not (<= z 5.2e-146))) (+ x (* y (/ z (- z a)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-56) || !(z <= 5.2e-146)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1d-56)) .or. (.not. (z <= 5.2d-146))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-56) || !(z <= 5.2e-146)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e-56) or not (z <= 5.2e-146): tmp = x + (y * (z / (z - a))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e-56) || !(z <= 5.2e-146)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); 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 <= -1e-56) || ~((z <= 5.2e-146))) tmp = x + (y * (z / (z - a))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e-56], N[Not[LessEqual[z, 5.2e-146]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-56} \lor \neg \left(z \leq 5.2 \cdot 10^{-146}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1e-56 or 5.19999999999999974e-146 < z Initial program 99.9%
Taylor expanded in t around 0 70.1%
associate-/l*83.2%
Simplified83.2%
if -1e-56 < z < 5.19999999999999974e-146Initial program 99.0%
Taylor expanded in z around 0 91.4%
*-commutative91.4%
associate-/l*91.5%
Simplified91.5%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.9e-35) (not (<= t 1.02e+77))) (- x (* t (/ y (- z a)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.9e-35) || !(t <= 1.02e+77)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (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 <= (-2.9d-35)) .or. (.not. (t <= 1.02d+77))) then
tmp = x - (t * (y / (z - a)))
else
tmp = x + (y * (z / (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 <= -2.9e-35) || !(t <= 1.02e+77)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.9e-35) or not (t <= 1.02e+77): tmp = x - (t * (y / (z - a))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.9e-35) || !(t <= 1.02e+77)) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.9e-35) || ~((t <= 1.02e+77))) tmp = x - (t * (y / (z - a))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.9e-35], N[Not[LessEqual[t, 1.02e+77]], $MachinePrecision]], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-35} \lor \neg \left(t \leq 1.02 \cdot 10^{+77}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -2.9000000000000002e-35 or 1.02e77 < t Initial program 99.1%
Taylor expanded in t around inf 80.3%
mul-1-neg80.3%
associate-/l*86.3%
Simplified86.3%
if -2.9000000000000002e-35 < t < 1.02e77Initial program 99.9%
Taylor expanded in t around 0 82.1%
associate-/l*92.4%
Simplified92.4%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2e-45) (not (<= z 9.5e+35))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e-45) || !(z <= 9.5e+35)) {
tmp = x + y;
} 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 <= (-2d-45)) .or. (.not. (z <= 9.5d+35))) then
tmp = x + y
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 <= -2e-45) || !(z <= 9.5e+35)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2e-45) or not (z <= 9.5e+35): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2e-45) || !(z <= 9.5e+35)) tmp = Float64(x + y); 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 <= -2e-45) || ~((z <= 9.5e+35))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2e-45], N[Not[LessEqual[z, 9.5e+35]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-45} \lor \neg \left(z \leq 9.5 \cdot 10^{+35}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.99999999999999997e-45 or 9.50000000000000062e35 < z Initial program 99.9%
Taylor expanded in z around inf 75.5%
if -1.99999999999999997e-45 < z < 9.50000000000000062e35Initial program 99.2%
Taylor expanded in z around 0 84.9%
associate-/l*84.8%
Simplified84.8%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.7e-46) (not (<= z 1.25e+36))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.7e-46) || !(z <= 1.25e+36)) {
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 <= (-5.7d-46)) .or. (.not. (z <= 1.25d+36))) 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 <= -5.7e-46) || !(z <= 1.25e+36)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.7e-46) or not (z <= 1.25e+36): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.7e-46) || !(z <= 1.25e+36)) 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 <= -5.7e-46) || ~((z <= 1.25e+36))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.7e-46], N[Not[LessEqual[z, 1.25e+36]], $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 -5.7 \cdot 10^{-46} \lor \neg \left(z \leq 1.25 \cdot 10^{+36}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -5.7000000000000003e-46 or 1.24999999999999994e36 < z Initial program 99.9%
Taylor expanded in z around inf 75.5%
if -5.7000000000000003e-46 < z < 1.24999999999999994e36Initial program 99.2%
Taylor expanded in z around 0 84.9%
*-commutative84.9%
associate-/l*84.9%
Simplified84.9%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e-52) (not (<= z 3.65e-109))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e-52) || !(z <= 3.65e-109)) {
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 <= (-1.2d-52)) .or. (.not. (z <= 3.65d-109))) 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 <= -1.2e-52) || !(z <= 3.65e-109)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e-52) or not (z <= 3.65e-109): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e-52) || !(z <= 3.65e-109)) 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 <= -1.2e-52) || ~((z <= 3.65e-109))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.2e-52], N[Not[LessEqual[z, 3.65e-109]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-52} \lor \neg \left(z \leq 3.65 \cdot 10^{-109}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.2000000000000001e-52 or 3.6500000000000002e-109 < z Initial program 99.9%
Taylor expanded in z around inf 74.6%
if -1.2000000000000001e-52 < z < 3.6500000000000002e-109Initial program 99.0%
Taylor expanded in z around 0 87.2%
*-commutative87.2%
associate-/l*87.3%
Simplified87.3%
Taylor expanded in x around inf 57.6%
Final simplification68.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.6%
Taylor expanded in z around 0 63.7%
*-commutative63.7%
associate-/l*63.8%
Simplified63.8%
Taylor expanded in x around inf 55.1%
Final simplification55.1%
(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 2024066
(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)))))