
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\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) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(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(Float64(y - z) / Float64(Float64(a - 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[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - z}{\frac{a - z}{t}}
\end{array}
Initial program 83.3%
associate-/l*97.2%
Simplified97.2%
clear-num97.1%
un-div-inv97.7%
Applied egg-rr97.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -9.5e+117)
x
(if (or (<= a -1.1e-230) (not (<= a 2.05e-246)))
(+ x t)
(* t (- 1.0 (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+117) {
tmp = x;
} else if ((a <= -1.1e-230) || !(a <= 2.05e-246)) {
tmp = x + t;
} else {
tmp = t * (1.0 - (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 (a <= (-9.5d+117)) then
tmp = x
else if ((a <= (-1.1d-230)) .or. (.not. (a <= 2.05d-246))) then
tmp = x + t
else
tmp = t * (1.0d0 - (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 (a <= -9.5e+117) {
tmp = x;
} else if ((a <= -1.1e-230) || !(a <= 2.05e-246)) {
tmp = x + t;
} else {
tmp = t * (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.5e+117: tmp = x elif (a <= -1.1e-230) or not (a <= 2.05e-246): tmp = x + t else: tmp = t * (1.0 - (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e+117) tmp = x; elseif ((a <= -1.1e-230) || !(a <= 2.05e-246)) tmp = Float64(x + t); else tmp = Float64(t * Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.5e+117) tmp = x; elseif ((a <= -1.1e-230) || ~((a <= 2.05e-246))) tmp = x + t; else tmp = t * (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e+117], x, If[Or[LessEqual[a, -1.1e-230], N[Not[LessEqual[a, 2.05e-246]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+117}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.1 \cdot 10^{-230} \lor \neg \left(a \leq 2.05 \cdot 10^{-246}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if a < -9.50000000000000041e117Initial program 71.4%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in x around inf 73.2%
if -9.50000000000000041e117 < a < -1.0999999999999999e-230 or 2.04999999999999993e-246 < a Initial program 86.3%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in z around inf 69.9%
if -1.0999999999999999e-230 < a < 2.04999999999999993e-246Initial program 84.5%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in a around 0 89.8%
associate-*r/89.8%
neg-mul-189.8%
Simplified89.8%
Taylor expanded in y around 0 94.6%
associate-+r+94.6%
mul-1-neg94.6%
unsub-neg94.6%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in t around inf 69.0%
Final simplification70.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.5e+22)
(+ x t)
(if (<= z 9.2e-37)
(+ x (* y (/ t a)))
(if (<= z 9e+129) (- x (* y (/ t z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e+22) {
tmp = x + t;
} else if (z <= 9.2e-37) {
tmp = x + (y * (t / a));
} else if (z <= 9e+129) {
tmp = x - (y * (t / z));
} else {
tmp = x + 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 (z <= (-7.5d+22)) then
tmp = x + t
else if (z <= 9.2d-37) then
tmp = x + (y * (t / a))
else if (z <= 9d+129) then
tmp = x - (y * (t / z))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e+22) {
tmp = x + t;
} else if (z <= 9.2e-37) {
tmp = x + (y * (t / a));
} else if (z <= 9e+129) {
tmp = x - (y * (t / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e+22: tmp = x + t elif z <= 9.2e-37: tmp = x + (y * (t / a)) elif z <= 9e+129: tmp = x - (y * (t / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e+22) tmp = Float64(x + t); elseif (z <= 9.2e-37) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 9e+129) tmp = Float64(x - Float64(y * Float64(t / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.5e+22) tmp = x + t; elseif (z <= 9.2e-37) tmp = x + (y * (t / a)); elseif (z <= 9e+129) tmp = x - (y * (t / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e+22], N[(x + t), $MachinePrecision], If[LessEqual[z, 9.2e-37], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+129], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+22}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-37}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+129}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -7.5000000000000002e22 or 9.0000000000000003e129 < z Initial program 71.0%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 84.5%
if -7.5000000000000002e22 < z < 9.1999999999999999e-37Initial program 92.3%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around 0 76.3%
*-commutative76.3%
associate-/l*83.0%
Simplified83.0%
if 9.1999999999999999e-37 < z < 9.0000000000000003e129Initial program 89.3%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in a around 0 78.6%
associate-*r/78.6%
neg-mul-178.6%
Simplified78.6%
Taylor expanded in y around inf 67.8%
mul-1-neg67.8%
associate-*l/71.4%
*-commutative71.4%
distribute-rgt-neg-in71.4%
distribute-frac-neg271.4%
Simplified71.4%
Final simplification82.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.4e+22)
(+ x t)
(if (<= z 5e-37)
(+ x (* y (/ t a)))
(if (<= z 5.8e+127) (- x (/ y (/ z t))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.4e+22) {
tmp = x + t;
} else if (z <= 5e-37) {
tmp = x + (y * (t / a));
} else if (z <= 5.8e+127) {
tmp = x - (y / (z / t));
} else {
tmp = x + 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 (z <= (-6.4d+22)) then
tmp = x + t
else if (z <= 5d-37) then
tmp = x + (y * (t / a))
else if (z <= 5.8d+127) then
tmp = x - (y / (z / t))
else
tmp = x + t
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+22) {
tmp = x + t;
} else if (z <= 5e-37) {
tmp = x + (y * (t / a));
} else if (z <= 5.8e+127) {
tmp = x - (y / (z / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.4e+22: tmp = x + t elif z <= 5e-37: tmp = x + (y * (t / a)) elif z <= 5.8e+127: tmp = x - (y / (z / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.4e+22) tmp = Float64(x + t); elseif (z <= 5e-37) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 5.8e+127) tmp = Float64(x - Float64(y / Float64(z / t))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.4e+22) tmp = x + t; elseif (z <= 5e-37) tmp = x + (y * (t / a)); elseif (z <= 5.8e+127) tmp = x - (y / (z / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.4e+22], N[(x + t), $MachinePrecision], If[LessEqual[z, 5e-37], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+127], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+22}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-37}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+127}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -6.4e22 or 5.8000000000000004e127 < z Initial program 71.0%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 84.5%
if -6.4e22 < z < 4.9999999999999997e-37Initial program 92.3%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around 0 76.3%
*-commutative76.3%
associate-/l*83.0%
Simplified83.0%
if 4.9999999999999997e-37 < z < 5.8000000000000004e127Initial program 89.3%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in a around 0 78.6%
associate-*r/78.6%
neg-mul-178.6%
Simplified78.6%
Taylor expanded in y around inf 67.8%
mul-1-neg67.8%
associate-*l/71.4%
*-commutative71.4%
distribute-rgt-neg-in71.4%
distribute-frac-neg271.4%
Simplified71.4%
Taylor expanded in x around 0 67.8%
mul-1-neg67.8%
associate-*r/71.4%
sub-neg71.4%
*-commutative71.4%
associate-/r/71.4%
Simplified71.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.5e+22)
(+ x t)
(if (<= z 4.6e+38)
(+ x (* y (/ t a)))
(if (<= z 2.4e+88) (* t (- 1.0 (/ y z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+22) {
tmp = x + t;
} else if (z <= 4.6e+38) {
tmp = x + (y * (t / a));
} else if (z <= 2.4e+88) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x + 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 (z <= (-6.5d+22)) then
tmp = x + t
else if (z <= 4.6d+38) then
tmp = x + (y * (t / a))
else if (z <= 2.4d+88) then
tmp = t * (1.0d0 - (y / z))
else
tmp = x + t
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.5e+22) {
tmp = x + t;
} else if (z <= 4.6e+38) {
tmp = x + (y * (t / a));
} else if (z <= 2.4e+88) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+22: tmp = x + t elif z <= 4.6e+38: tmp = x + (y * (t / a)) elif z <= 2.4e+88: tmp = t * (1.0 - (y / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+22) tmp = Float64(x + t); elseif (z <= 4.6e+38) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 2.4e+88) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.5e+22) tmp = x + t; elseif (z <= 4.6e+38) tmp = x + (y * (t / a)); elseif (z <= 2.4e+88) tmp = t * (1.0 - (y / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+22], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.6e+38], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+88], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+22}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+38}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+88}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -6.49999999999999979e22 or 2.3999999999999999e88 < z Initial program 70.6%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around inf 82.7%
if -6.49999999999999979e22 < z < 4.6000000000000002e38Initial program 92.2%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around 0 74.6%
*-commutative74.6%
associate-/l*81.5%
Simplified81.5%
if 4.6000000000000002e38 < z < 2.3999999999999999e88Initial program 99.6%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 82.8%
associate-*r/82.8%
neg-mul-182.8%
Simplified82.8%
Taylor expanded in y around 0 82.8%
associate-+r+82.8%
mul-1-neg82.8%
unsub-neg82.8%
associate-/l*82.9%
Simplified82.9%
Taylor expanded in t around inf 74.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.1e+55) (not (<= y 1.7e+33))) (* y (+ (/ t (- a z)) (/ x y))) (+ x (* z (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.1e+55) || !(y <= 1.7e+33)) {
tmp = y * ((t / (a - z)) + (x / y));
} else {
tmp = x + (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 ((y <= (-4.1d+55)) .or. (.not. (y <= 1.7d+33))) then
tmp = y * ((t / (a - z)) + (x / y))
else
tmp = x + (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 ((y <= -4.1e+55) || !(y <= 1.7e+33)) {
tmp = y * ((t / (a - z)) + (x / y));
} else {
tmp = x + (z * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.1e+55) or not (y <= 1.7e+33): tmp = y * ((t / (a - z)) + (x / y)) else: tmp = x + (z * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.1e+55) || !(y <= 1.7e+33)) tmp = Float64(y * Float64(Float64(t / Float64(a - z)) + Float64(x / y))); else tmp = Float64(x + Float64(z * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -4.1e+55) || ~((y <= 1.7e+33))) tmp = y * ((t / (a - z)) + (x / y)); else tmp = x + (z * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.1e+55], N[Not[LessEqual[y, 1.7e+33]], $MachinePrecision]], N[(y * N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+55} \lor \neg \left(y \leq 1.7 \cdot 10^{+33}\right):\\
\;\;\;\;y \cdot \left(\frac{t}{a - z} + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if y < -4.09999999999999981e55 or 1.7e33 < y Initial program 81.8%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in y around inf 74.9%
Taylor expanded in y around inf 86.3%
+-commutative86.3%
Simplified86.3%
if -4.09999999999999981e55 < y < 1.7e33Initial program 84.5%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in y around 0 78.4%
mul-1-neg78.4%
unsub-neg78.4%
*-commutative78.4%
associate-*r/91.1%
Simplified91.1%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.14) (not (<= z 8.5e-37))) (- x (* t (/ (- y z) z))) (- x (/ (- z y) (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.14) || !(z <= 8.5e-37)) {
tmp = x - (t * ((y - z) / z));
} 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 ((z <= (-0.14d0)) .or. (.not. (z <= 8.5d-37))) then
tmp = x - (t * ((y - z) / z))
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 ((z <= -0.14) || !(z <= 8.5e-37)) {
tmp = x - (t * ((y - z) / z));
} else {
tmp = x - ((z - y) / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.14) or not (z <= 8.5e-37): tmp = x - (t * ((y - z) / z)) else: tmp = x - ((z - y) / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.14) || !(z <= 8.5e-37)) tmp = Float64(x - Float64(t * Float64(Float64(y - z) / z))); else tmp = Float64(x - Float64(Float64(z - y) / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -0.14) || ~((z <= 8.5e-37))) tmp = x - (t * ((y - z) / z)); else tmp = x - ((z - y) / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.14], N[Not[LessEqual[z, 8.5e-37]], $MachinePrecision]], N[(x - N[(t * N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z - y), $MachinePrecision] / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.14 \lor \neg \left(z \leq 8.5 \cdot 10^{-37}\right):\\
\;\;\;\;x - t \cdot \frac{y - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z - y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -0.14000000000000001 or 8.5000000000000007e-37 < z Initial program 75.2%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in a around 0 68.7%
mul-1-neg68.7%
unsub-neg68.7%
associate-/l*87.3%
Simplified87.3%
if -0.14000000000000001 < z < 8.5000000000000007e-37Initial program 92.7%
associate-/l*96.8%
Simplified96.8%
clear-num96.7%
un-div-inv98.0%
Applied egg-rr98.0%
Taylor expanded in a around inf 87.9%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.7e+22) (not (<= z 4e+112))) (+ x t) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e+22) || !(z <= 4e+112)) {
tmp = x + t;
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.7d+22)) .or. (.not. (z <= 4d+112))) then
tmp = x + t
else
tmp = x + ((y * t) / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e+22) || !(z <= 4e+112)) {
tmp = x + t;
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e+22) or not (z <= 4e+112): tmp = x + t else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e+22) || !(z <= 4e+112)) tmp = Float64(x + t); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.7e+22) || ~((z <= 4e+112))) tmp = x + t; else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e+22], N[Not[LessEqual[z, 4e+112]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+22} \lor \neg \left(z \leq 4 \cdot 10^{+112}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -1.7e22 or 3.9999999999999997e112 < z Initial program 69.2%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 82.4%
if -1.7e22 < z < 3.9999999999999997e112Initial program 93.5%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in y around inf 85.5%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.7e+168) (not (<= y 9.6e+93))) (* y (/ t (- a z))) (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.7e+168) || !(y <= 9.6e+93)) {
tmp = y * (t / (a - z));
} else {
tmp = x + 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 ((y <= (-1.7d+168)) .or. (.not. (y <= 9.6d+93))) then
tmp = y * (t / (a - z))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.7e+168) || !(y <= 9.6e+93)) {
tmp = y * (t / (a - z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.7e+168) or not (y <= 9.6e+93): tmp = y * (t / (a - z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.7e+168) || !(y <= 9.6e+93)) tmp = Float64(y * Float64(t / Float64(a - z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.7e+168) || ~((y <= 9.6e+93))) tmp = y * (t / (a - z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.7e+168], N[Not[LessEqual[y, 9.6e+93]], $MachinePrecision]], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+168} \lor \neg \left(y \leq 9.6 \cdot 10^{+93}\right):\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if y < -1.70000000000000001e168 or 9.60000000000000042e93 < y Initial program 80.2%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in y around inf 77.3%
Taylor expanded in x around 0 51.5%
*-commutative51.5%
associate-*r/61.7%
Simplified61.7%
if -1.70000000000000001e168 < y < 9.60000000000000042e93Initial program 84.5%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around inf 74.4%
Final simplification70.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.4e+22) (not (<= z 1.5e-104))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.4e+22) || !(z <= 1.5e-104)) {
tmp = x + t;
} 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 <= (-6.4d+22)) .or. (.not. (z <= 1.5d-104))) then
tmp = x + t
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 <= -6.4e+22) || !(z <= 1.5e-104)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.4e+22) or not (z <= 1.5e-104): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.4e+22) || !(z <= 1.5e-104)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.4e+22) || ~((z <= 1.5e-104))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.4e+22], N[Not[LessEqual[z, 1.5e-104]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+22} \lor \neg \left(z \leq 1.5 \cdot 10^{-104}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.4e22 or 1.5000000000000001e-104 < z Initial program 76.4%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in z around inf 75.4%
if -6.4e22 < z < 1.5000000000000001e-104Initial program 92.8%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in x around inf 58.4%
Final simplification68.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.55e+120) t (if (<= t 1.7e+237) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.55e+120) {
tmp = t;
} else if (t <= 1.7e+237) {
tmp = x;
} else {
tmp = 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 <= (-2.55d+120)) then
tmp = t
else if (t <= 1.7d+237) then
tmp = x
else
tmp = 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 <= -2.55e+120) {
tmp = t;
} else if (t <= 1.7e+237) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.55e+120: tmp = t elif t <= 1.7e+237: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.55e+120) tmp = t; elseif (t <= 1.7e+237) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.55e+120) tmp = t; elseif (t <= 1.7e+237) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.55e+120], t, If[LessEqual[t, 1.7e+237], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{+120}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+237}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -2.55000000000000014e120 or 1.7000000000000002e237 < t Initial program 49.6%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in a around 0 62.8%
associate-*r/62.8%
neg-mul-162.8%
Simplified62.8%
Taylor expanded in y around 0 57.3%
associate-+r+57.3%
mul-1-neg57.3%
unsub-neg57.3%
associate-/l*68.3%
Simplified68.3%
Taylor expanded in t around inf 64.6%
Taylor expanded in y around 0 39.6%
if -2.55000000000000014e120 < t < 1.7000000000000002e237Initial program 91.9%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in x around inf 62.8%
(FPCore (x y z t a) :precision binary64 (- x (* (/ t (- a z)) (- z y))))
double code(double x, double y, double z, double t, double a) {
return x - ((t / (a - z)) * (z - y));
}
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 - ((t / (a - z)) * (z - y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((t / (a - z)) * (z - y));
}
def code(x, y, z, t, a): return x - ((t / (a - z)) * (z - y))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(t / Float64(a - z)) * Float64(z - y))) end
function tmp = code(x, y, z, t, a) tmp = x - ((t / (a - z)) * (z - y)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{t}{a - z} \cdot \left(z - y\right)
\end{array}
Initial program 83.3%
associate-/l*97.2%
Simplified97.2%
Final simplification97.2%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 83.3%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in a around 0 67.6%
associate-*r/67.6%
neg-mul-167.6%
Simplified67.6%
Taylor expanded in y around 0 67.8%
associate-+r+67.8%
mul-1-neg67.8%
unsub-neg67.8%
associate-/l*67.8%
Simplified67.8%
Taylor expanded in t around inf 31.0%
Taylor expanded in y around 0 19.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} 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) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
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) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024086
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))